Start a new topic

How to exclude Model tab from AutoCAD drawing in PDF

I am trying to modify the sample code for PDFs to remove the model tab in AutoCAD file when creating a PDF due to a lifecycle change.  Can anyone help me with how to do this?


Hello Thomas,


We do have an article on this topic on our knowledge base. You can download the sample and either modify that sample job or just copy-paste the 'GetAutoCADOnExport' function to your job. This function returns a scriptblock that can be passed to the '-OnExport' parameter of the 'Export-Document' commandlet. To exclude the model tab, you'd need to pass something like this to the 'Export-Document' Commandlet


Export-Document ..... -OnExport (GetAutoCADOnExport -ExcludeModel)


Please note, that the scriptblock generated by the 'GetAutoCADOnExport' function only works for AutoCAD files. So if you also process other file types you should pass a different or no scriptblock to the '-OnExport'.

----------------------------

Viktor Gobbi

Technical Support

 

Please mark your thread as solved if your question was answered

Where does this go in the sample jobs?  


I am not a coding expert and not sure where this goes.

Hello Thomas,


You could use the sample job that is attached to the article. It is a PDF sample job but you can set variables to exclude the model and layouts of AutoCAD files. The variables to exclude the sheets are (as of writing this) in line 70 and 71. If you just want to exclude the model you could use the following settings:

$ExcludeAcadLayouts = $false
$ExcludeAcadModel = $true


Otherwise, you could copy-paste the 'GetAutoCADOnExport' function (from the sample job attached to the article) to the top of your job. Then you would need to modify the 'Export-Document' call. This call takes a script block as the '-OnExport' parameter. The provided function (in this case 'GetAutoCADOnExport') can generate a script block to remove the model sheet from an AutoCAD drawing, that you can pass to the 'Export-Document' call via the '-OnExport' parameter. You would just need to modify the 'Export-Document' call as I stated in my previous post.


----------------------------

Viktor Gobbi

Technical Support

 

Please mark your thread as solved if your question was answered

Is the sample only for DWG extensions?  I will still need to have a second job for IDW extension correct?

This does not work or I am just not getting it.  Is there any way you can take this and add it to the sample job that is given with the software?

Hello Thomas,


Sorry I somehow missed your previous post. The Job should work for DWG as well as IDW files. But in this case I think it would be faster to resolve this problem using a ticket. I am going to create a ticket for you and we will get back to you.


----------------------------

Viktor Gobbi

Technical Support

 

Please mark your thread as solved if your question was answered


1 person likes this
Login or Signup to post a comment