Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Ilogic PDF export showing rasterized view after model update

3 REPLIES 3
SOLVED
Reply
Message 1 of 4
AlexanderVokes
554 Views, 3 Replies

Ilogic PDF export showing rasterized view after model update

I am making a small auto drawing ilogic rule to make custom parts read from a excel file and export to PDF.

Problem is that inventor does not fully calculate the views after changing dimensions of the part and updating the view, instead going straight ahead and exporting the PDF. Before the PDF export code I have: 

InventorVb.DocumentUpdate()

It appears that the PDF is exported only with the rasterized view:

image.png

However if I put in a MsgBox before the PDF export it works fine, as it seems to have time to update the views even if I smash the OK button as fast as possible:

image.png

There are quite a few drawings to do so I'd like to avoid pressing that OK button.

 

I have already tried this instead:

System.Threading.Thread.CurrentThread.Sleep(2000)

Which is much slower but does not help the views to update, as it seems to pause the view update process too.

 

Is there some other code to allow the view to complete the update before exporting?

 

Thanks!

Tags (1)
3 REPLIES 3
Message 2 of 4

@AlexanderVokes,

 

Hoping that below options would help to line visibility in PDF.

oOptions.Value("All_Color_AS_Black") = 1
oOptions.Value("Remove_Line_Weights") = 0

For further investigation, can you please share sample drawing to test?

 

Please make sure that files are non confidential.

 

Thanks and regards,


CHANDRA SHEKAR G
Developer Advocate
Autodesk Developer Network



Message 3 of 4

Hi @chandra.shekar.g

Thanks for your reply!

 

I have already set those options the way I like, with remove line weights=0.

As my second picture shows, the pdf export works fine if the model and views are properly updated before export. The only problem is when the view update is not completed before export.

Message 4 of 4

I found a solution here: https://forums.autodesk.com/t5/inventor-forum/drawing-view-events-ilogic/td-p/7216317

Thanks to @martin.jacko and @lmc.engineering!

 

Basically the code checks if the views are updated, and waits if they are not until they are completed. It proceeeds to the PDF export which then works correctly.

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

Post to forums  

Autodesk Design & Make Report