Set Support Path Position with lisp?

Set Support Path Position with lisp?

DC-MWA
Collaborator Collaborator
1,586 Views
3 Replies
Message 1 of 4

Set Support Path Position with lisp?

DC-MWA
Collaborator
Collaborator

Hi all,

Happy thanksgiving!!

I have a cool lisp that sets up support paths.  I need to set one of the paths to be at the top of the list. The program does not remove or mess with the existing support paths in any way.

See the image from what I'm trying to achieve. I need the "C:\mwa-support\bin\resources" path 1st in line as shown.

Capture.JPG

 

Also, lisp is attached.

I'm hoping someone has done this before and can point me in the right direction.

thanks

0 Likes
Accepted solutions (1)
1,587 Views
3 Replies
Replies (3)
Message 2 of 4

Ajilal.Vijayan
Advisor
Advisor
Accepted solution

One way is to reset the path values.

(defun c:DO_AddSupportPath (/ path files pathlist)
(vl-load-com)

(setq path (strcat
";C:\\mwa-support\\bin\\apps"
";C:\\mwa-support\\bin\\lsp"
";C:\\mwa-support\\bin\\resources"
";C:\\mwa-support\\bin\\lsp\\mw electrical"
";C:\\mwa-support\\bin\\lsp\\mwa-ada"
";C:\\mwa-support\\bin\\lsp\\mwa-site"
";C:\\mwa-support\\bin\\resources\\pats"
";C:\\MWA-Support\\mwa-details\\00 Gen\\title sheets\\Agencies"
";C:\\mwa-support\\mwa-details\\10 site"
";C:\\mwa-support\\mwa-details\\20 floor plan"
";C:\\mwa-support\\mwa-details\\30 enlarged fp"
";C:\\mwa-support\\mwa-details\\40 roof"
";C:\\mwa-support\\mwa-details\\50 exterior"
";C:\\mwa-support\\mwa-details\\60 clgs-sections"
";C:\\mwa-support\\mwa-details\\70 door_window"
";C:\\mwa-support\\mwa-details\\80 interiors"
";C:\\Users\\Owner\\desktop")
)
(setq files (vla-get-files
(vla-get-preferences
(vlax-get-acad-object)
)
)
)
;get the current path list
(setq clist (vlax-get-property files 'SupportPath))
(setq clist (strcat "C:\\mwa-support\\bin\\resources;" clist path))

(vlax-put-property files 'SupportPath clist)
(princ)
);end DO_AddSupportPath
0 Likes
Message 3 of 4

DC-MWA
Collaborator
Collaborator

Perfect!

 

Thank you very much!!

0 Likes
Message 4 of 4

dlanorh
Advisor
Advisor
(defun c:DO_AddSupportPath (/ path files pathlist)
(vl-load-com)

(setq path (strcat
";C:\\mwa-support\\bin\\apps"
";C:\\mwa-support\\bin\\lsp"
";C:\\mwa-support\\bin\\resources"
";C:\\mwa-support\\bin\\lsp\\mw electrical"
";C:\\mwa-support\\bin\\lsp\\mwa-ada"
";C:\\mwa-support\\bin\\lsp\\mwa-site"
";C:\\mwa-support\\bin\\resources\\pats"
";C:\\MWA-Support\\mwa-details\\00 Gen\\title sheets\\Agencies"
";C:\\mwa-support\\mwa-details\\10 site"
";C:\\mwa-support\\mwa-details\\20 floor plan"
";C:\\mwa-support\\mwa-details\\30 enlarged fp"
";C:\\mwa-support\\mwa-details\\40 roof"
";C:\\mwa-support\\mwa-details\\50 exterior"
";C:\\mwa-support\\mwa-details\\60 clgs-sections"
";C:\\mwa-support\\mwa-details\\70 door_window"
";C:\\mwa-support\\mwa-details\\80 interiors"
";C:\\Users\\Owner\\desktop")
)
(setq files (vla-get-files
(vla-get-preferences
(vlax-get-acad-object)
)
)
)
(setq pathlist (vla-get-supportpath files))
(if (not (vl-string-search path pathlist))
(vla-put-supportpath files (strcat "C:\\mwa-support\\bin\\resources;" pathlist path))
)
(princ)
);end DO_AddSupportPath

I am not one of the robots you're looking for

0 Likes