Hi there --- I've been following this thread ... unfortunately I just get an error if I try and 'export/ save a copy as' of the flat pattern
Hi! This is Inventor Professional forum. I am able to export flat pattern to DXF or DWG or SAT from Inventor Professional. Do you have access to Inventor? Based on the image you captured, it looks like you are using F360 on Mac. You may want to go to the following forum.
https://forums.autodesk.com/t5/fusion-360-design-validate/bd-p/124
Many thanks!
dxf from ipt...
Public Sub ExportDxf() Dim oDoc As PartDocument oDoc = ThisApplication.ActiveDocument Dim oCompDef As SheetMetalComponentDefinition oCompDef = oDoc.ComponentDefinition If oCompDef.HasFlatPattern = False Then oCompDef.Unfold Else oCompDef.FlatPattern.Edit End If Dim sOut As String If ExportInner = True Then sOut = "FLAT PATTERN DXF?AcadVersion=2004&OuterProfileLayer=IV_INTERIOR_PROFILES" Else sOut = "FLAT PATTERN DXF?AcadVersion=2004&OuterProfileLayer=IV_OUTER_PROFILE" End If ' Get document's full file name Dim sFname As String sFname = oDoc.FullFileName ' The file format will depend on the extension ' Set file name extension to ".DXF" sFname = Left$(sFname, Len(sFname) - 3) & "dxf" oCompDef.DataIO.WriteDataToFile( sOut, sFname) End Sub
dxf from iam...
'define the active document as an assembly file Dim oAsmDoc As AssemblyDocument oAsmDoc = ThisApplication.ActiveDocument oAsmName = Left(oAsmDoc.DisplayName, Len(oAsmDoc.DisplayName) -4) 'check that the active document is an assembly file If ThisApplication.ActiveDocument.DocumentType <> kAssemblyDocumentObject Then MessageBox.Show("Please run this rule from the assembly file.", "iLogic") Exit Sub End If 'get user input RUsure = MessageBox.Show ( _ "This will create a DXF file for all of the asembly components that are sheet metal." _ & vbLf & "This rule expects that the part file is saved." _ & vbLf & " " _ & vbLf & "Are you sure you want to create DXF for all of the assembly components?" _ & vbLf & "This could take a while.", "iLogic - Batch Output DXFs ",MessageBoxButtons.YesNo) If RUsure = vbNo Then Return Else End If oPath = ThisDoc.Path oDataMedium = ThisApplication.TransientObjects.CreateDataMedium oContext = ThisApplication.TransientObjects.CreateTranslationContext oContext.Type = IOMechanismEnum.kFileBrowseIOMechanism oOptions = ThisApplication.TransientObjects.CreateNameValueMap 'get DXF target folder path oFolder = oPath & "\" & oAsmName & " DXF Files" 'Check for the DXF folder and create it if it does not exist If Not System.IO.Directory.Exists(oFolder) Then System.IO.Directory.CreateDirectory(oFolder) End If '- - - - - - - - - - - - - '- - - - - - - - - - - - -Component - - - - - - - - - - - - 'look at the files referenced by the assembly Dim oRefDocs As DocumentsEnumerator oRefDocs = oAsmDoc.AllReferencedDocuments Dim oRefDoc As Document 'work the the drawing files for the referenced models 'this expects that the model has been saved For Each oRefDoc In oRefDocs iptPathName = Left(oRefDoc.FullDocumentName, Len(oRefDoc.FullDocumentName) - 3) & "ipt" 'check that model is saved If(System.IO.File.Exists(iptPathName)) Then Dim oDrawDoc As PartDocument oDrawDoc = ThisApplication.Documents.Open(iptPathName, True) oFileName = Left(oRefDoc.DisplayName, Len(oRefDoc.DisplayName)) Try 'Set the DXF target file name Try CustomName =iProperties.Value(oFileName, "Custom", "PF_PRT_ZNR") Catch CustomName ="XXX" 'Wert, wenn iPropertie PF_PRT_ZNR nicht existiert End Try oDataMedium.FileName = oFolder & "\" & CustomName & " " & oFileName & ".dxf" Dim oCompDef As SheetMetalComponentDefinition oCompDef = oDrawDoc.ComponentDefinition If oCompDef.HasFlatPattern = False Then oCompDef.Unfold Else oCompDef.FlatPattern.Edit End If Dim sOut As String sOut = "FLAT PATTERN DXF?AcadVersion=2004&OuterProfileLayer=IV_OUTER_PROFILE" oCompDef.DataIO.WriteDataToFile( sOut, oDataMedium.FileName) 'just for check its works coretcly 'i=MessageBox.Show(oDataMedium.FileName, "Title",MessageBoxButtons.OKCancel) 'MessageBox.Show(i,"title",MessageBoxButtons.OK) 'If i=2 Then 'Exit Sub 'End If oCompDef.FlatPattern.ExitEdit Catch End Try oDrawDoc.Close Else End If Next
@Anonymous,
If you are a tin manufacturer with laser and water jet, please look around here..ilogic-ubungsmodelle
and ifeature and screencasts...
First of all, I would like to commend you for the amazing solution, then I ask you if It is possible to customize the dxf file, for example, by removing some layers.
Would it be possible to include the *.ini dxf configuration file in the program?
Thanks in advance
Best regards
A.F.
Hi @Anonymous,
of course you can customize the dxf, but please in new post (please mark solution) for all to help
Can't find what you're looking for? Ask the community or share your knowledge.