Sheetmetal Export DXF flat pattern - using ilogic with custom cofiguration file

Sheetmetal Export DXF flat pattern - using ilogic with custom cofiguration file

Anonymous
Not applicable
3,521 Views
1 Reply
Message 1 of 2

Sheetmetal Export DXF flat pattern - using ilogic with custom cofiguration file

Anonymous
Not applicable

Greetings all, 

 

I am in the process of setting up an export rule in ilogic and have followed the following: 

 

https://forums.autodesk.com/t5/inventor-customization/ilogic-for-creating-flat-pattern-for-sheet-met...

 

This method works great however is there a way to define the config file? 

I am assuming that it is somewhere in this string: 

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=2010&OuterProfileLayer=OUT PRO"
oCompDef.DataIO.WriteDataToFile( sOut, oDataMedium.FileName)
oCompDef.FlatPattern.ExitEdit
Catch
End Try

We use dxf's for lasercutting and would like to be able to bulk export sheetmetal flat patterns without any fold lines or etch markings, just inner profile and outer profile

 

 

thanks in advance 

 

0 Likes
Accepted solutions (1)
3,522 Views
1 Reply
Reply (1)
Message 2 of 2

Sergio.D.Suárez
Mentor
Mentor
Accepted solution

Hi, in addition to the information that I shared in the other thread, here I leave you the material that appears in the programming aid of the inventor API, there you will find very useful information, I hope it helps you. Regards

 

 

 

 

 

Translate - Sheet Metal to DXF API Sample Description

The sample code below writes a sheet metal file out as DXF. DWG is also supported. Use either the FLAT PATTERN DWG or FLAT PATTERN DXF formats.There are several optional arguments that can be specified as part of the format string. E.g. 'FLAT PATTERN DXF?TangentLayer=Tangents&SimplifySplines=True'). Below are the names of these arguments and relevant default values. The output will use these values unless you override them as part of the input string.

ArgumentTypeDefault ValueNote
TangentLayerStringIV_TANGENT 
OuterProfileLayerStringIV_OUTER_PROFILE 
ArcCentersLayerStringIV_ARC_CENTERS 
InteriorProfilesLayerStringIV_INTERIOR_PROFILES 
BendLayerStringIV_BENDBendUpLayer + BendDownLayer (legacy support)
BendUpLayerStringIV_BEND 
BendDownLayerStringIV_BEND_DOWN 
ToolCenterLayerStringIV_TOOL_CENTERToolCenterUpLayer + ToolCenterDownLayer (legacy support)
ToolCenterUpLayerStringIV_TOOL_CENTER 
ToolCenterDownLayerStringIV_TOOL_CENTER_DOWN 
FeatureProfilesLayerStringIV_FEATURE_PROFILESFeatureProfilesUpLayer + FeatureProfilesDownLayer (legacy support)
FeatureProfilesUpLayerStringIV_FEATURE_PROFILES 
FeatureProfilesDownLayerStringIV_FEATURE_PROFILES_DOWN 
AltRepFrontLayerStringIV_ALTREP_FRONT 
AltRepBackLayerStringIV_ALTREP_BACK 
UnconsumedSketchesLayerStringIV_UNCONSUMED_SKETCHES 
TangentRollLinesLayerStringIV_ROLL_TANGENT 
RollLinesLayerStringIV_ROLL 
***ColorString *** indicates name of layer from the argument column. RGB values separated by ;. Example: TangentLayerColor=255;0;0
***LineTypeLong *** indicates name of layer from the argument column. Long value from LineTypeEnum. Example: TangentLayerLineType=37644
***LineWeightDouble *** indicates name of layer from the argument column. Value in centimeters. Example: TangentLayerLineWeight=.1016
CustomizeFilenameString  
AcadVersionString 2018, 2013, 2010, 2007, 2004, 2000, or R12 (for DXF only)
SimplifySplinesBooleanTrueEnable spline replacement by linear segments
SplineToleranceDouble0.01Chord tolerance for spline replacement
AdvancedLegacyExportBooleanTrue 
MergeProfilesIntoPolylineBooleanFalseBuild a polyline of the exterior profiles
RebaseGeometryBooleanFalseMove geometry to 1st quadrant
InvisibleLayersString List of layer names to make invisible, separated by ;

Code Samples

The following sample demonstrates creating an R12 DXF file that will have a layer called Outer where the the curves for the outer shape will be created.
Public Sub WriteSheetMetalDXF()
    ' Get the active document.  This assumes it is a part document.
    Dim oDoc As PartDocument
    Set oDoc = ThisApplication.ActiveDocument

    ' Get the DataIO object.
    Dim oDataIO As DataIO
    Set oDataIO = oDoc.ComponentDefinition.DataIO

    ' Build the string that defines the format of the DXF file.
    Dim sOut As String
    sOut = "FLAT PATTERN DXF?AcadVersion=R12&OuterProfileLayer=Outer"

    ' Create the DXF file.
    oDataIO.WriteDataToFile sOut, "C:\temp\flat2.dxf"
End Sub

Please accept as solution and give likes if applicable.

I am attaching my Upwork profile for specific queries.

Sergio Daniel Suarez
Mechanical Designer

| Upwork Profile | LinkedIn