Create Paths Autocad

Create Paths Autocad

My_Civil_3D
Advocate Advocate
377 Views
4 Replies
Message 1 of 5

Create Paths Autocad

My_Civil_3D
Advocate
Advocate

I have a lisp File that created paths in the Support folder settings. the issue is that it only created the first path and not all of them is there a specific way of loading more than one path? this the code i'm using: i have removed my actual paths for privacy reasons

 

(DEFUN AddSupportPath (dir / tmp Cpath)
  (VL-LOAD-COM)
  (SETQ	Cpath (GETENV "ACAD") tmp (STRCAT ";" dir ";"))
  (IF (NOT (VL-STRING-SEARCH dir cpath)) (SETENV "ACAD" (STRCAT Cpath ";" dir)))
  (PRINC)
)
(AddSupportPath "PATH 1")
(AddSupportPath "PATH 2")
(AddSupportPath "PATH 3")

 

 

 

Civil 3D Certified Professional
0 Likes
378 Views
4 Replies
Replies (4)
Message 2 of 5

Sea-Haven
Mentor
Mentor

Have a look at this example

 

(setq *files*  (vla-get-files  (vla-get-preferences (vlax-get-Acad-object))))
;make new support paths exist + new
(setq paths (vla-get-SupportPath *files*))
(setq newpaths "P:\\autodesk\\supportfiles;P:\\autodesk\\lisp;P:\\autodesk\\fonts;")
(setq newpath (strcat newpaths paths))
(vla-put-SupportPath *files* newpath)

 

0 Likes
Message 3 of 5

My_Civil_3D
Advocate
Advocate

thank you this worked, just one question. what is the correct wording to get the trusted path?

Civil 3D Certified Professional
0 Likes
Message 4 of 5

My_Civil_3D
Advocate
Advocate

i see it also created duplicate support files, but managed to add a condition to see if it exists, i also have a question regarding creating buttons and a toolbar with lisp, can i inbox you

Civil 3D Certified Professional
0 Likes
Message 5 of 5

Sea-Haven
Mentor
Mentor

1st the easy one its not really all that secure if you can change it easily.

(setq oldtrust (getvar 'trustedpaths))
(setq newtrust (strcat oldtrust ";" "L:\\Autodesk..."))
(setvar 'trustedpaths newtrust)

 Send me a PM re make a toolbar. I use the make a custom mnu method very easy using notepad.

0 Likes