CAD PANACEA HAS MOVED TO http://cadpanacea.com
13 February 2007
Setting support paths via lisp          

This sort of goes along with my customization post from a while back.

Here is an example of how to set your support file search paths using ACAD.LSP. By doing it using this method, you don't have to worry about profiles, .ARG files, etc. Your users are free to customize anything not controlled by this startup routine. If something gets messed up, just restart AutoCAD, and everything reloads.


(vl-load-com)
; This sets a reference to the install path of your product

(setq acadloc
(vl-registry-read
(strcat "HKEY_LOCAL_MACHINE\\" (vlax-product-key))
"ACADLOCATION")
); This sets a reference to the files portion of the acad preferences
(setq *files* (vla-get-files
(vla-get-preferences (vlax-get-acad-object))
))
; This builds the string of support file search paths
(setq sfsp
(strcat
"\\\\SERVER\\CAD\\SUPPORT;"
"\\\\SERVER\\CAD\\LISP;"
"\\\\SERVER\\CAD\\FONTS;"
(getvar "ROAMABLEROOTPREFIX") "SUPPORT;"
acadloc "\\SUPPORT;"
acadloc "\\HELP;"
acadloc "\\EXPRESS;"
acadloc "\\SUPPORT\\COLOR;"
acadloc "\\LAND;"
(getvar "LOCALROOTPREFIX") "SUPPORT;"
"C:\\Program Files\\Common Files\\Autodesk Shared\\GIS\\FDO\\2.0;"
"C:\\Program Files\\Common Files\\Autodesk Shared\\GIS\\FDO\\2.0\\Oracle;"
"C:\\Program Files\\Common Files\\Autodesk Shared\\GIS\\FDO\\2.0\\ArcSDE;"
"C:\\Program Files\\Autodesk Land Desktop 2006\\Land;"
"C:\\Program Files\\Dotsoft\\Toolpac\\;"
"C:\\Program Files\\Dotsoft\\XL2CAD"
)
)
; This actually applies the above string to the current session of AutoCAD.
(vla-put-SupportPath *files* sfsp)
; Here are some examples of setting other things
(vla-put-TemplateDwgPath *files* "\\\\SERVER\\CAD\\TEMPLATE")
(vla-put-PrinterConfigPath *files* "\\\\SERVER\\CAD\\PLOTTERS")
; Release the object
(vlax-release-object *files*)

You should place this in your ACAD.LSP file, not ACAD200x.LSP.


Where do you put ACAD.LSP? In the directory that is at the TOP of your support file search path. In the above example, this one would go in

\\SERVER\CAD\SUPPORT

Labels:


PermaLink       Posted 2/13/2007 09:45:00 PM     
4 COMMENTS!


Comment from: Anonymous Anonymous
Date: April 12, 2007 at 10:14:00 AM CDT  

OK this is a fantastic post, I love the idea of setting these during startup and not worrying about loading ARG files all the time. I have tried to use this code in our setup, and many of the settings seem to work fine, but not all. Here is what I have set up, nothing after the line with the PrinterConfigPath variable seems to be getting set for me. Please let me know if you see any errors in what I am trying t do, thanks for any help you can give.

-Chris Summers

; This sets a reference to the install path of your product
(setq acadloc
(vl-registry-read
(strcat "HKEY_LOCAL_MACHINE\\" (vlax-product-key))
"ACADLOCATION")
); This sets a reference to the files portion of the acad preferences
(setq *files* (vla-get-files
(vla-get-preferences (vlax-get-acad-object))
))
; This builds the string of support file search paths
(setq sfsp
(strcat
"\\\\ahi\\support\\CAD_Install\\LD6\ahi;"
"\\\\ahi\\support\\CAD_Install\\LD6\\ahi\\custom\\bmp;"
"\\\\ahi\\support\\CAD_Install\\LD6\\ahi\\custom;"
"\\\\ahi\\support\\CAD_Install\\LD6\\ahi\\custom\\2k6;"
(getvar "ROAMABLEROOTPREFIX") "SUPPORT;"
acadloc "\\SUPPORT;"
acadloc "\\HELP;"
acadloc "\\EXPRESS;"
acadloc "\\SUPPORT\\COLOR;"
acadloc "\\LAND;"
(getvar "LOCALROOTPREFIX") "SUPPORT;"
)
)
; This actually applies the above string to the current session of AutoCAD.
(vla-put-SupportPath *files* sfsp)
; Here are some examples of setting other things
(vla-put-TemplateDwgPath *files* "\\\\ahi\\support\\CAD_Install\\LD6\ahi\\TEMPLATE")
(vla-put-PrinterConfigPath *files* "\\\\ahi\\support\\CAD_Install\\LD6\ahi\\PLOTTERS")
(vla-put-PrinterDescDir *files* "c:\\ahi\\DRV")
(vla-put-PrinterStyleSheetDir *files* "c:\\ahi\\PLOT STYLES")
(vla-put-PrinterConfigDir *files* "c:\\ahi\\Plotters\\Autodesk Land Desktop 2006 PC3 Files")
(vla-put-ToolPalettePath *files* "%RoamableRootFolder%\\support\\ToolPalette;C:\\ahi\\Tool Palettes")
(vla-put-QnewTemplate *files* "c:\\ahi\\template\\ah-ld6.dwt")
(vla-put-TempDirectory *files* "C:\\Temp\\")



; Release the object
(vlax-release-object *files*)


Comment from: Blogger R.K. McSwain
Date: April 12, 2007 at 10:21:00 AM CDT  

A couple of the paths only have a single slash "\" instead of a double slash "\\".


Comment from: Anonymous Anonymous
Date: October 13, 2008 at 2:45:00 PM CDT  

I'm new to Vlisp but want to use your method to automate the setting of the support paths. Where can I find a list of all of the configuration path names for use in VL? In you example you use: TemplateDwgPath, PrinterConfigPath, etc. What about the corresponding names for main and enterprise cui's, etc.

Tom Buck


Comment from: Blogger R.K. McSwain
Date: October 13, 2008 at 4:26:00 PM CDT  

Tom, take a look at the object model in the acad_dev.chm help file. You can also use the command (vlax-dump-object) function inside of the VLIDE.

Post a comment