Trying to remove support paths

Trying to remove support paths

chris.neelin
Contributor Contributor
1,250 Views
3 Replies
Message 1 of 4

Trying to remove support paths

chris.neelin
Contributor
Contributor

Still a rookie but I'm getting there !!

I have the routine below that sets 2 paths for Tool Palettes, this one sets the path for the electrical group. Because there are multiple disciplines, before this runs, I would like to delete all the paths in the toolPalettePath .

Greatly appreciate any ideas.

 

(defun prog_main ( / )

;Get environment variable USERPROFILE
(setq IESCAD2016 (strcat (getenv "USERPROFILE") "\\IESCAD2016"))

(setq ELECTRICCAL (strcat IESCAD2016 "\\EL\\EL_Tool_Palette")) ; set the discipline's path

(setq COM (strcat IESCAD2016 "\\Common_Tool_Palette")) ; set the path for the common tools

; Get the current file preferences
(setq pFiles (vla-get-files (vla-get-preferences (vlax-get-acad-object))))

; Get current tool palette path
(setq thePath (vla-get-toolPalettePath pFiles))

; add paths
(setq thePath (strcat ELECTRICAL ";" COM ";" thePath))

; update support path variable
(vla-put-toolPalettePath pFiles thePath)

)
(prog_main)

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

SeeMSixty7
Advisor
Advisor
Accepted solution
It looks like you can blank it out using

(vla-put-toolpalettepath pfiles "")

But since there has to be a path provided, AutoCAD automatically puts in the default.
Then you can use that default path as your value to be appended to.

Good Luck
0 Likes
Message 3 of 4

krzysztof.psujek
Advocate
Advocate
Hi, you can check Lee Mac's funcions

http://www.lee-mac.com/addremovesupportpaths.html
0 Likes
Message 4 of 4

chris.neelin
Contributor
Contributor

SeeMSixty7

This works perfectly thanks so much for your help and prompt response

 

 

0 Likes