Jump to content

Another plot to PDF question - PC3 settings


Steven P

Recommended Posts

Good afternoon, and apologies for sounding like I only have a 1 tracked mind but...

 

I have some free time and am reviewing my Plot to PDF LISP routine. The plotting is done via (Command "-.plot" .... ) method - it works and I can understand it.

 

One thing I would find quite useful is to create a temporary PC3 for the plot ('Apply Changes for the current plot only' option), primarily so that I can uncheck the 'show results in viewer' option, stop Adobe from opening after the plot.

 

Does anyone know how I can do this?

 

 

I am thinking that the code could be similar to:

(if (= "Yes" plot_with_no_preview)

  (prog

    (... configure temporary PC3 file...)

  )

)

... some more stuff...

(command "_.plot"....)

 

 

One thought I had was to copy the relevant PC3 file to say, windows TEMP folder, modify the copy, and use that copy for the plot, would that work?.. and how would I get that plot to look for the PC3 file in another folder? 

 

Any guidance would be great, thanks.

Link to comment
Share on other sites

Hi there. I would take an approach more along the 2nd you mentioned, with something different, which would to copy the pc3 file, but not to a temp folder. You don't want to start having to change the the preferences because by changing the plottermanager folder for a temp one to plot a single PDF without launching the viewer, you would loose the ability to use any other plotting devices on the system without digging in "search paths. file names, and file locations" if it doesn't get restored for any reason. Most users won't know how to restore it, hence your own question "how would I get that plot to look for the PC3 file in another folder?". That said, following these steps you will create a permanent pc3. 

  1. Plot a drawing, choose your pc3. Hit the "properties" button (a)
  2. In the "device and document settings tab (b) - select the "custom properties" item (c), then click the "custom properties..." button (d)
  3. In the properties window, the last thing in the bottom is a checkbox "open in PDF viewer when done". Uncheck it, then hit "ok".
  4. Back on the plotter configuration editor, hit "save As.." (e)
  5. Give it a name accordingly ie the original "DWG To PDF.pc3" I would saveas "DWG To PDF no preview.pc3" then save.
  6. Back again to the plotter configuration editor dialog, hit CANCEL (to discard the change made to the original file)

image.png.c24906f4af0a673e353fe4111f61a5fb.png

 

After doing that, you will have access to both pc3 files in the dropdown plotter name section of the plot menu. That is good for manual use.

To do it in lisp, now you can use that

(defun putPlotDevice (device layout)
   (vla-put-ConfigName
      (vla-item
         (vla-get-Layouts
            (vla-get-activedocument (vlax-get-acad-object))
         )
         layout
      )
   device
   )
)

The only thing needed is to swap the plot device just before your plot command

(if (= "Yes" plot_with_no_preview)
    (putplotdevice "DWG To PDF no preview.pc3" (getvar 'ctab))
    (putplotdevice "DWG To PDF.pc3" (getvar 'ctab))
)
plot here

If I were you I would store the plot device before changing it to restore it back after the plot. We hate when lisp routines change settings, don't we? :)

(defun getPlotDevice ()
   (vla-get-ConfigName
      (vla-item
         (vla-get-Layouts
            (vla-get-activedocument (vlax-get-acad-object))
         )
         (getvar 'ctab)
      )
   )
)

Hope it helps. Cheers.

If this helped you solve your inquiry, or found this information useful, please mark this message accordingly.

  • Like 1
Link to comment
Share on other sites

Thanks Jeff, that is a great and detailed answer - thanks for taking the time to do all of that. I will do what I want this way.

 

I was ideally wanting a solution contained within a single LISP routine (or other programming) that I could just send to colleagues without worrying about them altering any of their settings. but I don't think that is possible. So I will create a different - no preview - PC3 and do things this way.

 

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...