Community
AutoCAD Forum
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Redefining plot issue on workaround for MD_ layers LW - overwritting PDFs fails

2 REPLIES 2
Reply
Message 1 of 3
Anonymous
457 Views, 2 Replies

Redefining plot issue on workaround for MD_ layers LW - overwritting PDFs fails

Since we use Acad 2014, some of my coworkers have started using viewbase style views. Since we have standards regarding lineweights, I've tried to find in vain a way to set the lineweight default values for the viewbase layers (MD_Annotation, MD_Hatching...) when CAD create them. Since i couldn't find any way to give them default values upon creation, my only option was to pre created in our templates all the layers generated by viewbase. The thing is that when someone purge a drawing prior to create the first viewbase, (which is 95% of the cases - designers make the design/3d model, purge, then the draftsman takes over the project to make the fab plans) the MD_ layers get deleted, and when they are generated again all the lineweights don't match our standards. I thought about the adding a dot on each layer in the titleblock but didn't as we wanted to keep the posibility of being able to purge these layers whenever they are not in use, mainly because we use a lot of xrefs...so it wasn't a viable option.

A guardian angel (jdiala - cadtutor.net forum) made me a simple yet very effective lisp redefining the plot command:

 

(defun C:vplot (/ laylist lwlist laytbl)
(setq laylist (list "MD_Annotation" "MD_Hatching" "MD_Hidden" "MD_Visible")
      lwlist  (list -3 5 13 -3)
      laytbl  (vla-get-layers (vla-get-activedocument (vlax-get-acad-object)))
)

(mapcar 
  (function  
    (lambda (a b) 
      (if 
        (tblsearch "LAYER" a)
        (vla-put-Lineweight (vla-item laytbl a ) b) 
        (princ (strcat "\nLayer " (strcase a) " does not exist")) )))
      laylist
      lwlist
)
(princ)
(initdia)
(command "_.plot")
)

 The lisp works like it is supposed to. When I plot a PDF file, and the PDF file name already exists (but is not opened, nor in read only),CAD ask if I want to overwrite the file, I say yes, Cad plot then open the PDF in the PDF viewer. (normal behavior). Don't know if it is related, but now, if I hit preview prior to plot, and in the preview window I right click then choose plot from within the right click menu, instead of asking if I want to overwrite it, sometimes Autocad don't ask anything and cancel the job (says so on the "click to view plot and publish details" popup). Same behavior occasionnaly occur using the publish command. Today one designer wasn't able to overwrite a PDF by simply hitting "ok" on the plot dialog, tried few times, came to get me to show me his issue and while I was there it worked without issue. When the issue occurs, deleting the PDF or restarting Autocad without acaddoc.lsp are 2 (slightly annoying) workarounds for this issue... but manual workaround can lead to costly errors if a previous version of a fabrication plan get released because the draftsman didn't realize that the PDF wasn't overwritten.

 

Many questions are now haunting my head...might the problem be caused from undefining the original plot command?

What I cant stop asking me right now is "What if the plot command I've undefined contained more than (initdia)(command "_.plot")?
Is there any way of looking at the lisp/code of an original command - in this instance the original Plot command? (To know exactly what we are redefining)
Could redefining any command be somehow.. hazardous?

Or maybe there is an already known issue not related to redefining the plot command?

Is there any way to control to what lineweigths the MD_ layers will have upon creation?

 

Any advices/suggestions/answers to the above questions would be appreciated!

*using DWG to PDF (by Autodesk) to plot PDFs.*

(sorry for the length of the post!) Cheers,

Jef!

2 REPLIES 2
Message 2 of 3
Anonymous
in reply to: Anonymous

Bumping this thread...

 

I did some tests and while on preview, right clicking and selecting plot to overwrite a PDF (that is not opened, nor in read only, and wether the pdf is on a server or locally written), systematically make Autocad cancel the job without any notice even tho the popup says "Plot and Publish Job Complete No errors or warnings found"

 

"heres the content of the "click to view plot and publish details"

[code]Job: - Canceled

Job ID: 8
Sheet set name:
Date and time started: 2013-12-10 14:55:09
Date and time completed: 2013-12-10 14:55:12
UserID: Jef
Profile ID: <<Unnamed Profile>>
Total sheets: 1
Sheets plotted: 0
Number of errors: 0
Number of warnings: 0

 Sheet: - Canceled

File: Drawing9.dwg
Category name:
Page setup:
Device name:
Plot file path:
Paper size: [/code]

 

Please advice

Jef!

Message 3 of 3
Anonymous
in reply to: Anonymous

Hi again. I did further testing, I'll narrow things down for you: the script posted has nothing to do with the issue. Please do these steps to replicate the bug.

-Launch the plot command. Using DWG To PDF - PDF ePlot - by Autodesk, hit preview, then on the preview window right click then select "plot" from menu. use the default name [drawing name - tab name.pdf] . works.

-Launch the plot command. Using DWG To PDF - PDF ePlot - by Autodesk, hit preview, then on the preview window right click then select "plot" from menu. use the default name [drawing name - tab name.pdf] . it works and overwrite.

 

Now load that as a lsp file or simply type it

(command "undefine" "plot")


(defun c:PLOT ( )
 (initdia)
 (command ".plot")
(princ)
)

 Now try to overwrite the same PDF the same way

 Launch plot command. using DWG To PDF - PDF ePlot - by Autodesk , hit preview, then on the preview window right click then select "plot" from menu. It won't work anymore, even though popup says "Plot and Publish Job Complete No errors or warnings found".

 

(using Product version: l.108.0.0 AutoCAD 2014 SP1)

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost