IDW Converting to PDF

IDW Converting to PDF

Anonymous
Not applicable
625 Views
2 Replies
Message 1 of 3

IDW Converting to PDF

Anonymous
Not applicable

Cheers,

 

I am Attempting to write an iLogic code to save all drawing files of referenced from the top level assembly drawing as PDFs. My code is saving the top level but not saving the other parts. I am trying to save them in my R: drive separate from the vault work space location so all on my server can access. I have attached my code. Any help is appreciated. 

 

Thank You, 

Josh

 

 

0 Likes
Accepted solutions (1)
626 Views
2 Replies
Replies (2)
Message 2 of 3

NSBowser
Advocate
Advocate
Accepted solution

Josh,

 

Your Saving each PDF successfully, unfortunately your saving them all with the Assembly Filename.

 

Near the beginning of your code you call:

oFileName = ThisDoc.FileName(False) 'without extension

While looping through the oRefDocs, you again call:

oFileName = ThisDoc.FileName(False) 'without extenstion

 This isn't setting the Filename to the new, open doc, it is still setting it to ThisDoc (Being the document which contains the rule... as such ThisDoc never changes while the rule is running)

 

For the sub parts, I would replace it with:

 

oFileName =System.IO.Path.GetFileNameWithoutExtension(oDrawDoc.FullFileName)

for the Assembly, I would replace it with

 

 

oAsmDrawingName = System.IO.Path.GetFileNameWithoutExtension(oAsmDrawingDoc.FullFileName)

 

 

Additionally, I had to add a "." on the one line for 

oDataMedium.FileName = oFolder & "\" & oFileName & "pdf"

to make it 

oDataMedium.FileName = oFolder & "\" & oFileName & ".pdf"

Your mileage may vary, but it seems the root of your problems are filenames

Hopefully this gets you sorted out. If you need further guidance after you sort those out, let us know.

 


Best of Luck

---------------------------------------------------------------------------------------------------------------------------------
If you find this reply helpful or insightful, please use the 'Accept as Solution' or 'Kudos' button below.
Message 3 of 3

Anonymous
Not applicable

Thank You.  This is going to save me so much time 

0 Likes