- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I have the following lisp that works perfectly .. except that each time it runs it adds the same path again and again. e.g. I set the path to "\\HELP\\" so each time I run the lisp I get , I would like it to just do it once ... any suggestions are greatly appreciated.
1st
c:\users\neelinch\iescad\help
2nd time
c:\users\neelinch\iescad\help
c:\users\neelinch\iescad\help
3rd time
c:\users\neelinch\iescad\help
c:\users\neelinch\iescad\help
c:\users\neelinch\iescad\help
-----------------------------------------------------------------------------
Below is the lisp
-----------------------------------------------------------------------------
;-----------------------------------------
; Add additional support File Paths
;-----------------------------------------
(defun MTO_PATH ( / )
;Get environment variable USERPROFILE
(setq IESCAD2016 (strcat (getenv "USERPROFILE") "\\IESCAD2016"))
(setq Help (strcat IESCAD2016 "\\Help\\"))
(setq COM (strcat IESCAD2016 "\\com\\lisp\\"))
(setq FONT (strcat IESCAD2016 "\\MTO_Fonts")) ; set path to MTO Specific fonts
(setq HATCH (strcat IESCAD2016 "\\MTO_HATCH"))
(setq HelpPD (strcat IESCAD2016 "\\PD\\Lisp\\")); Planning and Design Lisp
(setq TrafficHelp (strcat IESCAD2016 "\\tr\\Help")); Traffic Sign Manuals
(setq PD_Block (strcat IESCAD2016 "\\PD\\Symbols\\")); Planning and Design Blocks
(vl-load-com)
;Store a reference to the Application Object
(setq acadObject (vlax-get-acad-object))
;Store a reference to the Preferences Object
(setq prefsObject (vlax-get-property acadObject 'Preferences))
;Store a reference to the Files Object
(setq tabnameObject (vlax-get-property prefsObject 'Files))
;Get the Support Path
(setq thePath (vlax-get-property tabnameObject 'SupportPath))
; add paths
(setq thePath (strcat FONT ";" Help ";" COM ";" HATCH ";" HelpPD ";" TrafficHelp ";" PD_Block ";" thePath))
; update support path variable
(vlax-put-property tabnameObject 'SupportPath thePath)
)
(MTO_PATH)
Solved! Go to Solution.