Author Topic: Autocad Settings not updating as per registy.  (Read 1502 times)

0 Members and 1 Guest are viewing this topic.

SPDCad

  • Bull Frog
  • Posts: 453
Autocad Settings not updating as per registy.
« on: January 30, 2008, 03:22:20 PM »
I have written the following code and it seems to work.
In that the windows registry changes but the Autocad-->Tools-->Options-->Printer Support-->Pen Styles setting does not.
This inconsistency bewteen the windows registry and Autocad setting causes Autocad to crash when I want to plot.
How does one get Autocad to update its profile as per registry?   

Code: [Select]
(Defun QCTB1 ()
   (if (= vl-load-com Nil)(vl-load-com));
   (setq PFL (#GET-CPROFILE)
PTH (strcat "HKEY_CURRENT_USER\\" (vlax-product-key))
    REG-KEY (strcat PTH "\\Profiles\\" PFL "\\General\\")
VALUE "Z:\\FFB\\Publish\\Pen Styles\\"
CURRENT (vl-registry-write REG-KEY "PrinterStyleSheetDir" VALUE)
   )
);

I have written the lisp to allows me to have only 3 ctb in my plot style options for 95% of the time, but when I need to plot a consultants drawing I will need their ctb which I would like to keep in another directory so that the wait time between pressing the plot icon button and the dialog box showing up is to a minimum.
I have found that the more ctb's and page setup styles one has the longer it takes to display the dialog box.
So only having 3 Ctbs listed in the pull down has the dialogs box displaying instantaneously as per a minute and a half because I have over 75 ctb's listed due to the various consultants I use.

Any help would be appreciated...
and thanks in advance.
« Last Edit: January 30, 2008, 03:26:00 PM by SPDCad »
AutoCAD 2010, w/ OpenDCL

visit: http://reachme.at/spd_designs

Bob Wahr

  • Guest
Re: Autocad Settings not updating as per registy.
« Reply #1 on: January 30, 2008, 03:57:57 PM »
AutoCAD loads all the registry settings into memory when it launches so changing the registry is only going to work if you close and reopen autocad. (AFAIK)




ronjonp

  • Needs a day job
  • Posts: 7531
Re: Autocad Settings not updating as per registy.
« Reply #2 on: January 30, 2008, 04:01:47 PM »
This should work on the fly:

Code: [Select]
(vla-put-printerstylesheetpath
  (vla-get-files
    (vla-get-preferences (vlax-get-acad-object))
  )
  "C:\\new\\path\\here"
)

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC