Message 1 of 7
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Thank you in advance for your understanding. I am completely new to iLogic.
For the last 2 weeks I have been trying to obtain the code that exports the design to dxf files for laser cutting.
I have modified several codes and have come up with one that works almost perfect.
I would like the DXF file name to be in the format:
(Thickness) - (Quantity) - (File name) - (material type).dxf
At the moment there is only the name and the extension.
Below is the code I am using.
What should I change?
Thank you for any advice.
Dim oDoc As Document
oDoc=ThisDoc.Document
Dim docFile As Document
For Each docFile In oDoc.AllReferencedDocuments
ThisApplication.Documents.Open(docFile.FullFileName,True)
Dim partDoc As PartDocument
partDoc=ThisApplication.ActiveDocument
If partDoc.SubType="{9C464203-9BAE-11D3-8BAD-0060B0CE6BB4}" Then
Dim oCompDef As SheetMetalComponentDefinition
oCompDef=partDoc.ComponentDefinition
Dim oDataIO As DataIO
oDataIO=oDoc.ComponentDefinition.DataIO
If oCompDef.HasFlatPattern=False Then
oCompDef.Unfold
Else
oCompDef.FlatPattern.Edit
End If
Dim sOut As String = "FLAT PATTERN DWG?AcadVersion=2000" _
+"&InvisibleLayers=IV_TANGENT;IV_BEND;IV_BEND_DOWN;IV_TOOL_CENTER;IV_TOOL_CENTER_DOWN;IV_ARC_CENTERS;IV_FEATURE_PROFILES;IV_UNCONSUMED_SKETCHES;IV_ROLL_TANGENT;IV_ROLL;IV_FEATURE_PROFILES_DOWN" _
+"&SimplifySplines=True" _
+"&LINEAR TOLERANCE=0.010" _
+"&MergeProfilesIntoPolyline=True" _
+"&RebaseGeometry=False" _
+"&TrimCenterlines=True"
Dim invPropSets As PropertySets
invPropSets=partDoc.PropertySets
Dim invPropSet As PropertySet
invPropSet=invPropSets.Item("Design Tracking Properties")
Dim invPartNumiProp As Inventor.Property
invPartNumiProp = invPropSet.Item("Part Number")
Dim invPartQty As Inventor.Property
invPropSet2 = invPartQty
Dim sFname As String
sFname=ThisDoc.Path &"\"& invPartNumiProp.Value & SheetMetal.GetActiveStyle &".dxf"
oCompDef.DataIO.WriteDataToFile(sOut,sFname)
oCompDef.FlatPattern.ExitEdit
If partDoc.ComponentDefinition.IsiPartFactory Or
partDoc.ComponentDefinition.IsiPartMember Then
partDoc.Save()
End If
Else
End If
partDoc.Close
Next
Solved! Go to Solution.