TheSwamp
Code Red => AutoLISP (Vanilla / Visual) => Topic started by: dubb on August 26, 2015, 05:29:14 PM
-
(vl-load-com)
(setq PreferenceFiles (vla-get-files (vla-get-preferences (vlax-get-acad-object))))
;print/plotter settings
(setq AddPrintPath (strcat "n:\\cad_support\\plotter"))
(setq CurrentPrintPath (strcat (vla-get-PrinterConfigPath PreferenceFiles)))
(setq NewPrintPath (strcat AddPrintPath";"CurrentPrintPath))
(vla-put-printerconfigpath PreferenceFiles NewPrintPath)
I get an error
Automation Error. Invalid Argument
What am I doing wrong? :nerdyembarassed:
-
I don't see anything wrong with your code - perhaps there is a bug with the ActiveX printerconfigpath property.
Try the following alternative method, changing the registry value directly:
(setq new
"n:\\cad_support\\plotter" cur
(getenv "PrinterConfigDir"))
)
-
This works Thanks Lee.
I don't see anything wrong with your code - perhaps there is a bug with the ActiveX printerconfigpath property.
Try the following alternative method, changing the registry value directly:
(setq new
"n:\\cad_support\\plotter" cur
(getenv "PrinterConfigDir"))
)
-
I'm not sure what you are even trying to do ? All you really need to do is
Not sure why you are pulling the old config path?
-
Not sure why you are pulling the old config path?
The OP is adding a new path to the existing set of paths.
-
His snippet seems to works on Vanilla 2016. He just needs to add a check to prevent duplicate line items.
Is there an advantage to writing to the registry directly vs ActiveX?