Hello everyone,
I've searched through this forum for a few options to export flat patterns to DXF, but those macros or iLogic rules didn't fit into my workflow. I tried to adapt them, but I lack the necessary knowledge.
Here's my workflow, and I hope someone could assist me:
If possible, I'd like the name of the DXF file to include:
Thank you!
example of dxf file name
<name of the file IPT> - qnty - Material - Ticknees
24018-P-007 _ Side Reinforcement - 3x - Steel AS3678 GR 250 - 2mm
This should help get you started
https://help.autodesk.com/view/INVNTOR/2022/ENU/?guid=WriteFlatPatternAsDXF_Sample
Dim oADoc As AssemblyDocument = ThisDoc.Document Dim oBOM As BOM = oADoc.ComponentDefinition.BOM oBOM.PartsOnlyViewEnabled = True Dim oBOMView As BOMView = oBOM.BOMViews.Item("Parts Only") For Each oBOMRow As BOMRow In oBOMView.BOMRows 'sheet metal document sub type If Not oBOMRow.ComponentDefinitions(1).Document.SubType.ToString = "{9C464203-9BAE-11D3-8BAD-0060B0CE6BB4}" Then Continue For Dim qty As Double = oBOMRow.ItemQuantity 'this takes the first document file for the row (should only be 1 unless duplicate part numbers) Dim oDoc As PartDocument = oBOMRow.ComponentDefinitions(1).Document 'export dxf Next
Thank you for your assistance.
However, I lack expertise in macros and coding, so I find myself somewhat stuck here. Additionally, I am more accustomed to SolidWorks rather than Inventor.
Could you possibly provide further elaboration on this macro or perhaps direct me to other users who may be able to assist?
Thank you for everything.
This is one of the most common requests on the forums. Some people like to like to try and create a rule themselves, some people just want a copy/paste that will work. Try this:
It might need bug fixing and can be improved on but its what your asking.
'get the document this rule is ran from Dim oADoc As AssemblyDocument = ThisDoc.Document Dim oBOM As BOM = oADoc.ComponentDefinition.BOM 'disable row merge for dupiclate part numbers oBOM.SetPartNumberMergeSettings(False) 'ignore suppressed components so you dont have to open the files in the background oBOM.HideSuppressedComponentsInBOM = True oBOM.PartsOnlyViewEnabled = True 'use parts only BOM to get sheet metal parts Dim oBOMView As BOMView = oBOM.BOMViews.Item("Parts Only") 'dxf format sOut = "FLAT PATTERN DXF?AcadVersion=R12&OuterProfileLayer=0&InteriorProfilesLayer=0&InvisibleLayers=IV_ARC_CENTERS;IV_BEND_DOWN;IV_BEND;IV_FEATURE_PROFILES&TrimCenterlinesAtContour=True" For Each oBOMRow As BOMRow In oBOMView.BOMRows 'sheet metal document sub type If Not oBOMRow.ComponentDefinitions(1).Document.SubType.ToString = "{9C464203-9BAE-11D3-8BAD-0060B0CE6BB4}" Then Continue For Dim qnty As Integer = oBOMRow.ItemQuantity 'this takes the first document file for the row (should only be 1 unless duplicate part numbers) Dim oDoc As PartDocument = oBOMRow.ComponentDefinitions(1).Document 'try to create flat pattern Dim oSMCD As SheetMetalComponentDefinition oSMCD = oDoc.ComponentDefinition If oSMCD.HasFlatPattern = False Try oSMCD.Unfold oSMCD.FlatPattern.ExitEdit Catch : Continue For : End Try End If Dim thickness As String = oSMCD.Thickness.Expression Dim material As String = oDoc.PropertySets.Item(3).Item("Material").Value 'create file name Dim dxfname As String = Left(oDoc.FullFileName, oDoc.FullFileName.Length - 4) & " - " & qnty & " - " & material & " - " & thickness 'create dxf oSMCD.DataIO.WriteDataToFile(sOut, dxfname) Next
thank you @daltonNYAW9 @daltonNYAW
To be honest I don't know much about macros.
but I was wondering if there anyone willing to develop this macro for me as a service?
the company that I work is willing to pay for this macro.
Let me know if someone provides this service.
thanks
@engineeringSEZWD These people do this I believe:
you could try to message other people on the "top soultions hiscores"
Curtis_Waguespack
Ralf_Krieg
Can't find what you're looking for? Ask the community or share your knowledge.