View Full Version : Set paths via lisp
sturner
2007-07-25, 07:45 PM
i've used this routine with ACAD 2004 and have had no problems now with ACAD 2007 it only works about 1/2 way it breaks at setting the paths for the printers did ACAD change the properties in 2007?? i looked at other threads and evrything looks fine this is the error:
; error: Automation Error. Invalid Argument
HERE is the portion that is giving me the problem
;; Set up the Printer Support paths.
;; Use double backslashes for each directory backslash
;; and separate folders with a semicolon.
(setq printSupportPath
(strcat
"O:\\STANDARDS\\MRACADSTD\\PLOTTERS"))
;;
(setq pmpSupportPath
(strcat
"O:\\STANDARDS\\MRACADSTD\\PLOTTERS\\PMP FILES"))
;;
(setq styleSupportPath
(strcat
"O:\\STANDARDS\\MRACADSTD\\PLOT STYLES"))
;;
;; Set the printer SupportPath Property
(vlax-put-property AcadFiles "PrinterConfigPath" printSupportPath)
;;
;; Set the printer PMPPath Property
(vlax-put-property AcadFiles "PrinterDescPath" pmpSupportPath)
;;
;; Set the printer plot stylePath Property
(vlax-put-property AcadFiles "PrinterStyleSheetPath" styleSupportPath)
Maybe try it this way?
(defun c:test ()
(vl-load-com)
(setq AcadFiles (vla-get-files (vla-get-preferences (vlax-get-acad-object))))
(vla-put-PrinterConfigPath AcadFiles "T:\\PlotterSupport\\Plotters32")
(vla-put-PrinterDescPath AcadFiles "T:\\PlotterSupport\\Drv32")
(vla-put-PrinterStyleSheetPath AcadFiles "T:\\PlotterSupport\\PlotStyles")
(princ)
)
I don't know why yours quit working. :?
Edit: make sure to change the paths to suit your paths.
ccowgill
2007-07-25, 08:59 PM
i've used this routine with ACAD 2004 and have had no problems now with ACAD 2007 it only works about 1/2 way it breaks at setting the paths for the printers did ACAD change the properties in 2007?? i looked at other threads and evrything looks fine this is the error:
; error: Automation Error. Invalid Argument
HERE is the portion that is giving me the problem
;; Set up the Printer Support paths.
;; Use double backslashes for each directory backslash
;; and separate folders with a semicolon.
(setq printSupportPath
(strcat
"O:\\STANDARDS\\MRACADSTD\\PLOTTERS"))
;;
(setq pmpSupportPath
(strcat
"O:\\STANDARDS\\MRACADSTD\\PLOTTERS\\PMP FILES"))
;;
(setq styleSupportPath
(strcat
"O:\\STANDARDS\\MRACADSTD\\PLOT STYLES"))
;;
;; Set the printer SupportPath Property
(vlax-put-property AcadFiles "PrinterConfigPath" printSupportPath)
;;
;; Set the printer PMPPath Property
(vlax-put-property AcadFiles "PrinterDescPath" pmpSupportPath)
;;
;; Set the printer plot stylePath Property
(vlax-put-property AcadFiles "PrinterStyleSheetPath" styleSupportPath)
what are you strcat "ing"?
sturner
2007-07-25, 10:29 PM
i figured it out, i was not connected to the server with the correct logical drive letters. as soon as i did it worked like a charm. DOH!
thanks for the help!
Adesu
2007-07-26, 01:53 AM
Hi tim,
I just got trouble.
Command: test
; error: Automation Error. Invalid Argument
Command:
Command: 'VLIDE
Command:
Command: test
; error: Automation Error. Invalid Argument
(defun c:test ()
(vl-load-com)
(setq AcadFiles (vla-get-files (vla-get-preferences (vlax-get-acad-object))))
(vla-put-PrinterConfigPath AcadFiles "C:\\Program Files\\AutoCAD 2005\\Support\\Plotters32")
(vla-put-PrinterDescPath AcadFiles "C:\\Program Files\\AutoCAD 2005\\Support\\Drv32")
(vla-put-PrinterStyleSheetPath AcadFiles "C:\\Program Files\\AutoCAD 2005\\Support\\PlotStyles")
(princ)
)
Maybe try it this way?
(defun c:test ()
(vl-load-com)
(setq AcadFiles (vla-get-files (vla-get-preferences (vlax-get-acad-object))))
(vla-put-PrinterConfigPath AcadFiles "T:\\PlotterSupport\\Plotters32")
(vla-put-PrinterDescPath AcadFiles "T:\\PlotterSupport\\Drv32")
(vla-put-PrinterStyleSheetPath AcadFiles "T:\\PlotterSupport\\PlotStyles")
(princ)
)
I don't know why yours quit working. :?
Edit: make sure to change the paths to suit your paths.
Hi tim,
I just got trouble.
Command: test
; error: Automation Error. Invalid Argument
Command:
Command: 'VLIDE
Command:
Command: test
; error: Automation Error. Invalid Argument
(defun c:test ()
(vl-load-com)
(setq AcadFiles (vla-get-files (vla-get-preferences (vlax-get-acad-object))))
(vla-put-PrinterConfigPath AcadFiles "C:\\Program Files\\AutoCAD 2005\\Support\\Plotters32")
(vla-put-PrinterDescPath AcadFiles "C:\\Program Files\\AutoCAD 2005\\Support\\Drv32")
(vla-put-PrinterStyleSheetPath AcadFiles "C:\\Program Files\\AutoCAD 2005\\Support\\PlotStyles")
(princ)
)
Hi Adesu,
Because of a mix of OS's and other issues here I use non-standard folders that reside on our network:
T:\\PlotterSupport\\Plotters32
T:\\PlotterSupport\\Drv32
T:\\PlotterSupport\\PlotStyles
Normally, IIR, these would be:
C:\Documents and Settings\<username>\Application Data\Autodesk\Autodesk <Product>\<version>\enu\Plotters
C:\Documents and Settings\<username>\Application Data\Autodesk\Autodesk <Product>\<version>\enu\Plotters\PMP Files
and
C:\Documents and Settings\<username>\Application Data\Autodesk\Autodesk <Product>\<version>\enu\Plot Styles.
Looking at the folder names you used in your code, I think all you need to do is verify that the folder names are correct and exist.
It would probably be good to write in some code to verify the folder exists prior to trying to set it.
vBulletin® v3.6.7, Copyright ©2000-2009, Jelsoft Enterprises Ltd.