Author Topic: switching plot style paths  (Read 11609 times)

0 Members and 1 Guest are viewing this topic.

danny

  • Guest
switching plot style paths
« on: January 19, 2006, 08:38:08 PM »
I'm am using lisp to switch between client and company plot style paths.  the lisp will switch the support path correctly but requires shutting down AutoCAD for it to work properly.
Is there a way to add or change a support path/ plot style path w/o shutting down and reopenning ACAD.
Mahalo for your help
-danny

Chuck Gabriel

  • Guest
Re: switching plot style paths
« Reply #1 on: January 19, 2006, 10:07:42 PM »
Are you modifying the registry directly, or are you working with the preferences object?

danny

  • Guest
Re: switching plot style paths
« Reply #2 on: January 19, 2006, 10:52:04 PM »
options
file
Printer Support File Path
Plot Style Table Search Path

Code: [Select]
(setenv "PrinterStyleSheetDir" "M:\\_Cad Support\\AutoCAD 2004\\Client_CTB")
Code: [Select]

path is changed correctly but ctb wont work unless ACAD is shutdown and reopened.

pmvliet

  • Guest
Re: switching plot style paths
« Reply #3 on: January 19, 2006, 11:01:35 PM »
Danny,

That works for me w/o having to get out of AutoCad.

Pieter

Chuck Gabriel

  • Guest
Re: switching plot style paths
« Reply #4 on: January 20, 2006, 07:55:02 AM »
Code: [Select]
(setq prefs (vla-get-preferences (vlax-get-acad-object))
      filePrefs (vla-get-files prefs)
)
(vla-put-printerstylesheetpath filePrefs "c:/plot styles")

danny

  • Guest
Re: switching plot style paths
« Reply #5 on: January 20, 2006, 02:40:05 PM »
chuck,
the code you provided works to the point of doing the plot.
example:
if I'm currently in a drawing and have my plot style path browsing to "m:/plot styles"
then I use your code,
I will now be browsing to "c:/plot styles" :-)
but when I do a plot, the ctb's will show up as color in preview and when printing. :-(
AutoCAD isn't reading the ctb correctly and takes exiting ACAD and reentering to work.

pmvliet,
when you used the code, did the plot preview show up correctly as well as the print?

Jeff_M

  • King Gator
  • Posts: 4096
  • C3D user & customizer
Re: switching plot style paths
« Reply #6 on: January 20, 2006, 08:24:15 PM »
Danny,
Using Chuck's code, try adding
Code: [Select]
(vla-refreshplotdeviceinfo
  (vla-get-activelayout
   (vla-get-activedocument
     (vlax-get-acad-object))))
Quote from: AcadHelp
Updates the plot, canonical media, and plot style table information to reflect the current system state.

edited to fix my inadvertent "test" line, props to Tim W for finding it....
« Last Edit: January 27, 2006, 07:29:37 PM by Jeff_M »

danny

  • Guest
Re: switching plot style paths
« Reply #7 on: January 27, 2006, 06:30:17 PM »
jeff,
got a error message
"no function definition: VLAX-GET-ACAD-DOCUMENT"
this is the code I used
Code: [Select]
(defun c:AHLCTBD ()
(setq prefs(vla-get-preferences (vlax-get-acad-object))
      filePrefs(vla-get-files prefs))
(vla-put-printerstylesheetpath filePrefs "M:\\_Cad Support\\AHL_CTB")
(vla-refreshplotdeviceinfo
  (vla-get-activelayout
   (vla-get-activedocument
     (vlax-get-acad-document))))
(alert "Notice:\nYou are now using AHL standard CTB's")
(princ)
)

T.Willey

  • Needs a day job
  • Posts: 5251
Re: switching plot style paths
« Reply #8 on: January 27, 2006, 06:46:29 PM »
Edit

Change it to
(vlax-get-Acad-Object)
instead of
(vlax-get-Acad-Document)
Tim

I don't want to ' end-up ', I want to ' become '. - Me

Please think about donating if this post helped you.

Jeff_M

  • King Gator
  • Posts: 4096
  • C3D user & customizer
Re: switching plot style paths
« Reply #9 on: January 27, 2006, 07:26:55 PM »
Oops!  :oops: Tim caught the "test" I put in there...... :roll:

T.Willey

  • Needs a day job
  • Posts: 5251
Re: switching plot style paths
« Reply #10 on: January 27, 2006, 07:36:14 PM »
Oops! :oops: Tim caught the "test" I put in there...... :roll:
Almost got by me.  I put the standard reply to that type of error
Quote
Add (vl-load-com), that should fix it.

Then I saw that it didn't look right.

Nice test Jeff.   :evil:
Tim

I don't want to ' end-up ', I want to ' become '. - Me

Please think about donating if this post helped you.

danny

  • Guest
Re: switching plot style paths
« Reply #11 on: January 30, 2006, 03:40:00 PM »
thanks guys,
The search path is changed correctly but I'm still having to close and reopen ACAD for the ctb's to work correctly. 
It must be something ACAD is doing @ startup.

deegeecees

  • Guest
Re: switching plot style paths
« Reply #12 on: January 30, 2006, 03:43:59 PM »
<guess> convertpstyles </guess>

T.Willey

  • Needs a day job
  • Posts: 5251
Re: switching plot style paths
« Reply #13 on: January 30, 2006, 03:55:04 PM »
thanks guys,
The search path is changed correctly but I'm still having to close and reopen ACAD for the ctb's to work correctly.
It must be something ACAD is doing @ startup.

I have heard this happening when you change things in the registry.  I haven't heard of a fix/workaround yet. :cry:  I will keep my ears (eyes) open for any suck fix/workaround.
Tim

I don't want to ' end-up ', I want to ' become '. - Me

Please think about donating if this post helped you.

danny

  • Guest
Re: switching plot style paths
« Reply #14 on: January 30, 2006, 04:12:38 PM »
(vl-registry-read)????

GDF

  • Water Moccasin
  • Posts: 2081
Re: switching plot style paths
« Reply #15 on: January 30, 2006, 04:20:48 PM »
Tim

(setenv "PrinterConfigDir" (strcat ARCH#CUSF "PlotCFG"))
(setenv "PrinterDescDir" (strcat ARCH#CUSF "PlotCFG")) ;correct
(setenv "PrinterStyleSheetDir" (strcat ARCH#CUSF "PlotCFG\\PlotStyles"))

This shows plotstyles found

(setenv "PrinterConfigDir" (strcat (getvar "ROAMABLEROOTPREFIX") "\\plotters"))
(setenv "PrinterDescDir" (strcat (getvar "ROAMABLEROOTPREFIX") "\\PMP Files"))
(setenv "PrinterStyleSheetDir" (strcat (getvar "ROAMABLEROOTPREFIX") "\\Plot Styles"))

This shows missing plotstyles

Toggleing back and forth in 2006 seems to work fine...without retarting.
Gary
Why is there never enough time to do it right, but always enough time to do it over?
BricsCAD 2020x64 Windows 10x64

T.Willey

  • Needs a day job
  • Posts: 5251
Re: switching plot style paths
« Reply #16 on: January 30, 2006, 05:01:55 PM »
(vl-registry-read)????
That is just to read what is in the registry, not to update it so that it works correctly in the current session.  At least that is my understanding.  But then again I don't mess with the registry unless I have to, and that doesn't happen too oftern.

Toggleing back and forth in 2006 seems to work fine...without retarting.
Gary
That doesn't seem to have worked for the Danny though per below.
chuck,
the code you provided works to the point of doing the plot.
example:
if I'm currently in a drawing and have my plot style path browsing to "m:/plot styles"
then I use your code,
I will now be browsing to "c:/plot styles" :-)
but when I do a plot, the ctb's will show up as color in preview and when printing. :-(
AutoCAD isn't reading the ctb correctly and takes exiting ACAD and reentering to work.

pmvliet,
when you used the code, did the plot preview show up correctly as well as the print?

I still don't have an answer.  What version are you using Danny?
Tim

I don't want to ' end-up ', I want to ' become '. - Me

Please think about donating if this post helped you.

danny

  • Guest
Re: switching plot style paths
« Reply #17 on: January 30, 2006, 05:36:08 PM »
acad version 2004
I'm still looking around for a solution.  Almost ready to give up though... :|
I've seen topics on switching plot paths, but those lisp are very similar. don't know if they ran into the same problem.

pmvliet

  • Guest
Re: switching plot style paths
« Reply #18 on: January 30, 2006, 06:27:10 PM »
I guess it doesn't switch the colortables correctly.
I know that was one reason why you couldn't change profiles during a session of AutoCad.

I bet it has to do when AutoCad reads in that information. It only does it upon startup.
Once it is read, it no longer looks at that information.

So somehow we need to figure out how to get AutoCad to re-read that variable...

 :|

Pieter