Author Topic: Support paths  (Read 3130 times)

0 Members and 1 Guest are viewing this topic.

V-Man

  • Bull Frog
  • Posts: 343
  • I exist therefore I am! Finally Retired!
Support paths
« on: July 08, 2004, 07:47:14 AM »
How does someone go about reading the Autocad support paths and removing certain paths?

Code: [Select]

(setq paths (vla-get-supportpath files))
AutoCAD 9 - 2023, AutoCADMap 2008 - 2010, Revit 2012 - 2022, Autocad Civil 3D 2023

Keith™

  • Villiage Idiot
  • Seagull
  • Posts: 16899
  • Superior Stupidity at its best
Support paths
« Reply #1 on: July 08, 2004, 08:20:35 AM »
You can set the acad variable acadprefix by simply resetting the environment variable ACAD ... by such means as (setenv "ACAD" yourpath)

Mind you that this may clear your default path settings in your options so be very careful.
Proud provider of opinion and arrogance since November 22, 2003 at 09:35:31 am
CadJockey Militia Field Marshal

Find me on https://parler.com @kblackie

V-Man

  • Bull Frog
  • Posts: 343
  • I exist therefore I am! Finally Retired!
Support paths
« Reply #2 on: July 08, 2004, 01:54:45 PM »
Is there any other way thru Vlisp? I have this code (Thanks Mark!)

This code gets the support paths. I want to be able to ADD/REMOVE as necessary thru lisp.

The problem is that we have tons of blocks from our library in many many different directories. I do not want to (Map) all of those directories in my support path. But thru some of my internal lisps, I want to be able to map certain drives/directories and when the lisp is complete it takes them back out of the support paths.

Code: [Select]

  (defun mst-GetSupportPath (/ path) ;; reads the Support File Search Path returns a string containing the entire path
    (setq path
          (vlax-get-property
            (vlax-get-property
              (vlax-get-property
                (vlax-get-acad-object)
                'Preferences)
              'Files)
            'SupportPath)
          ); setq
    ); defun
AutoCAD 9 - 2023, AutoCADMap 2008 - 2010, Revit 2012 - 2022, Autocad Civil 3D 2023

hendie

  • Guest
Support paths
« Reply #3 on: July 08, 2004, 02:14:29 PM »
if it's purely for Block management, have you considered a block management app ? then you wouldn't have to bother about adding and removing paths ~ I'd seriously recommend taking a look at Blockwerx ~try the free demo  ~ see this post[/u]

Mark

  • Custom Title
  • Seagull
  • Posts: 28762
Support paths
« Reply #4 on: July 08, 2004, 02:44:27 PM »
Code: [Select]

(defun mst-GetSupportPath (/ path) ;; reads the Support File Search Path returns a string containing the entire path
    (setq path
          (vlax-get-property
            (vlax-get-property
              (vlax-get-property
                (vlax-get-acad-object)
                'Preferences)
              'Files)
            'SupportPath)
          ); setq
    ); defun

(setq old-path (mst-GetSupportPath)
 add-to-path ";c:\\Windows"
 ); dont' forget the ';' (semicolon)

(vlax-put-property
  (vlax-get-property
(vlax-get-property
 (vlax-get-acad-object)
 'Preferences
 )
'Files
)
  'SupportPath
  (strcat old-path add-to-path)
  )
TheSwamp.org  (serving the CAD community since 2003)

Keith™

  • Villiage Idiot
  • Seagull
  • Posts: 16899
  • Superior Stupidity at its best
Support paths
« Reply #5 on: July 08, 2004, 03:25:35 PM »
You could simply do this:

Code: [Select]

(defun addpath (newpath)
 (setq @path@ (getvar "acadprefix"))
 (setenv "path" (strcat @path@ newpath))
)

(defun restorepath (path)
 (setenv "path" path)
)


This actually changes the acadprefix system variable and as such the registry values. Anytime you modify the search path it is written to the registry.
Proud provider of opinion and arrogance since November 22, 2003 at 09:35:31 am
CadJockey Militia Field Marshal

Find me on https://parler.com @kblackie