Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.
davis.j
in reply to: enrico.silva1

I am also interested if anyone has preformed this in Inventor ilogic. The 3rd party app "DXF Exporter" can do it.

I use the following Ilogic routine but it would be nice to have it trim the bend lines too.

Sub Main()
On Error GoTo ErrorHandler
	oDoc = ThisDoc.Document
	 
	If oDoc.SubType = "{9C464203-9BAE-11D3-8BAD-0060B0CE6BB4}" Then
	 
		Dim oCompDef As SheetMetalComponentDefinition = oDoc.ComponentDefinition
	 
		If oCompDef.HasFlatPattern = False Then
			oCompDef.Unfold
		Else
			oCompDef.FlatPattern.Edit
		End If
			
		Dim sOut As String = "FLAT PATTERN DXF?AcadVersion=2010" _
			+ "&OuterProfileLayer=0" _
			+ "&OuterProfileLayerColor=0 ;0 ;0" _
			+ "&InteriorProfilesLayer=0" _
			+ "&InteriorProfilesLayerColor=0 ;0 ;0" _
			+ "&BendDownLayer=Scribe" _
			+ "&BendDownLayerLineType=37633" _
			+ "&BendDownLayerColor=0 ;0 ;255" _
			+ "&BendUpLayer=Scribe" _
			+ "&BendUpLayerLineType=37633" _
			+ "&BendUpLayerColor=0 ;0 ;255" _
			+ "&InvisibleLayers=IV_FEATURE_PROFILES;IV_FEATURE_PROFILES_DOWN" _
			+ ";IV_ALTREP_FRONT;IV_ALTREP_BACK;IV_ROLL_TANGENT;IV_ROLL;IV_TANGENT" _
			+ ";IV_TOOL_CENTER;IV_TOOL_CENTER_DOWN;IV_ARC_CENTERS;IV_UNCONSUMED_SKETCHES" _
			+ "&RebaseGeometry=True" _
			+ "&SimplifySplines=True" _
			+ "&SplineTolerance=0.01" _
			+ "&MergeProfilesIntoPolyline=True"
		
		Dim oPath As String = ThisDoc.Path

		If oPath = String.Empty Then
			MsgBox("Please save your document first.", , "iLogic Export Flat Pattern")
			Exit Sub
		End If
			
		Dim sFname As String
		Dim sfd As New SaveFileDialog
		
		dName = ThisDoc.Document.DisplayName
		sName = Left(dName, Len(dName) - 4)
		
		sfd.Filter = "DXF Files (*.dxf)|*dxf"
		sfd.InitialDirectory = oPath
	'	sfd.FileName = iProperties.Value("Project", "Part Number")
		sfd.FileName = sName & ".dxf"
	 
		If sfd.ShowDialog = System.Windows.Forms.DialogResult.OK Then
			sFname = sfd.FileName
			If Not Strings.Right(sFname, 4) = ".dxf" Then sFname = sFname & ".dxf"
		Else
			Exit Sub
		End If
		

	 	oCompDef.DataIO.WriteDataToFile(sOut, sFname)
		oCompDef.FlatPattern.ExitEdit
			
		MessageBox.Show("Your file was saved in the following directory: " + sFname)
	Else
		MessageBox.Show("Only sheet metal parts can be exported as DXF.")
	End If
Exit Sub

ErrorHandler:
	MessageBox.Show("The file is in use!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Stop, MessageBoxDefaultButton.Button1)
    Exit Sub
End Sub