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.
Solved! Go to Solution.
Solved by marcin_otręba. Go to Solution.
use:
ThisDoc.Document.ReferencedDocuments.Item(1).SaveAs(DWFPath & "\" & ThisDoc.FileName(False) & ".dwf", True)
Can't find what you're looking for? Ask the community or share your knowledge.