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: 

Creating a DWF of a model from its IDW

2 REPLIES 2
SOLVED
Reply
Message 1 of 3
Anonymous
361 Views, 2 Replies

Creating a DWF of a model from its IDW

I am fairly new to iLogic and am running into an issue I am hoping someone can help me with.  Currently we are using the code shown below to create DXF and PDF versions of a completed IDW  and them to specific locations to a specific location.  It has now been requested that we also save a DWF of the model that the drawing is based on. I can do that seperately from the model but, would like to consolidate the creation of all three into one operation and have been unsuccessful so far. I always end up with a DWF of the IDW.  Is there a way to reference either the IPT or IAM that the IDW is based on and create a DWF of it from the IDW?  Any help would be greatly appreciated. 

 

'Gets the Workspace Path
WorkspacePath= ThisDoc.WorkspacePath()
'Gets the Length of the WorkspacePath String
WorkspacePathLength = Len(WorkspacePath)
'Gets just the Path of the file
PathOnly = ThisDoc.Path
'Removes the Workspace Path from FullPath
PDFName = ThisDoc.FileName(False)
'document name without extension)
DirectoryPath = Strings.Left(PDFName, 5)
'Sets the Dirctory that the PDF should be saved in
PDFPath = "X:\PDF\" & DirectoryPath
'Checks to see if that directory exists, if not, it is created
If(Not System.IO.Directory.Exists(PDFPath)) Then
 System.IO.Directory.CreateDirectory(PDFPath)
End If
'Saves the PDF in the desired location
ThisDoc.Document.SaveAs(PDFPath & "\" & ThisDoc.FileName(False) &
".pdf" , True)

'Gets the Workspace Path
WorkspacePath= ThisDoc.WorkspacePath()
'Gets the Length of the WorkspacePath String
WorkspacePathLength = Len(WorkspacePath)
'Gets just the Path of the file
PathOnly = ThisDoc.Path
'Removes the Workspace Path from FullPath
DXFName = ThisDoc.FileName(False)
'document name without extension)
DirectoryPath = Strings.Left(DXFName, 5)
'Sets the Dirctory that the DXF should be saved in
DXFPath = "X:\DXF\" & DirectoryPath
'Checks to see if that directory exists, if not, it is created
If(Not System.IO.Directory.Exists(DXFPath)) Then
 System.IO.Directory.CreateDirectory(DXFPath)
End If
'Saves the DXF in the desired location
ThisDoc.Document.SaveAs(DXFPath & "\" & ThisDoc.FileName(False) &
".dxf" , True)

 Thank you.

2 REPLIES 2
Message 2 of 3
marcin_otręba
in reply to: Anonymous

use:

ThisDoc.Document.ReferencedDocuments.Item(1).SaveAs(DWFPath & "\" & ThisDoc.FileName(False) &
".dwf", True)
Message 3 of 3
Anonymous
in reply to: marcin_otręba

This works perfectly!  Thank you for your help!

 

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

Post to forums  

Autodesk Design & Make Report