Using a VBA macro or an iLogic rule you can automate export of an unfolded sheetmetal part from Inventor to a selected version of the DXF format, to your preferred layers and linetypes.
The export process is controlled through the WriteData operation and through its parameters given as arguments of the "FLAT PATTERN DXF" or "FLAT PATTERN DWG" operations.
A simple version of such iLogic or VBA macro looks e.g. like this (different parameter types are listed; must be invoked from the unfold environment):
Dim oDataIO As DataIO
Dim oPart As PartDocument
Dim sDXFname As String
Dim csOut As String
oPart = ThisApplication.ActiveDocument
oDataIO = oPart.ComponentDefinition.DataIO
sDXFname = oPart.FullFileName & ".DXF"
'csOut = "FLAT PATTERN DXF?TangentLayer=Tangents&SimplifySplines=True"
'csOut = "FLAT PATTERN DXF?AcadVersion=2000&BendUpLayer=IV_BEND&BendUpLayerLineType=37634&BendUpLayerColor=255;255;0&BendDownLayerLineType=37634"
csOut = "FLAT PATTERN DXF?AcadVersion=R12" _
+ "&OuterProfileLayer=IV_OUTER_PROFILE" _
+ "&InteriorProfilesLayer=IV_INTERIOR_PROFILES" _
+ "&InvisibleLayers=IV_TANGENT;IV_BEND;IV_BEND_DOWN;IV_TOOL_CENTER;IV_TOOL_CENTER_DOWN;IV_ARC_CENTERS;IV_FEATURE_PROFILES;IV_FEATURE_PROFILES_DOWN;IV_ALTREP_FRONT;IV_ALTREP_BACK;IV_UNCONSUMED_SKETCHES;IV_ROLL_TANGENT;IV_ROLL"
oDataIO.WriteDataToFile (csOut, sDXFname)
An overview of the individual parameters - all parameters of the type "*Layer" can have also additional parameters with the suffixes LineType, LineWeight, or Color (e.g. TangentLayerLineType, TangentLayerColor):
Parameter | Type | Default | Note |
TangentLayer | String | IV_TANGENT | |
OuterProfileLayer | String | IV_OUTER_PROFILE | |
ArcCentersLayer | String | IV_ARC_CENTERS | |
InteriorProfilesLayer | String | IV_INTERIOR_PROFILES | |
BendLayer | String | IV_BEND | BendUpLayer + BendDownLayer (legacy) |
BendUpLayer | String | IV_BEND | |
BendDownLayer | String | IV_BEND_DOWN | |
ToolCenterLayer | String | IV_TOOL_CENTER | ToolCenterUpLayer + ToolCenterDownLayer (legacy) |
ToolCenterUpLayer | String | IV_TOOL_CENTER | |
ToolCenterDownLayer | String | IV_TOOL_CENTER_DOWN | |
FeatureProfilesLayer | String | IV_FEATURE_PROFILES | FeatureProfilesUpLayer + FeatureProfilesDownLayer (legacy) |
FeatureProfilesUpLayer | String | IV_FEATURE_PROFILES | |
FeatureProfilesDownLayer | String | IV_FEATURE_PROFILES_DOWN | |
AltRepFrontLayer | String | IV_ALTREP_FRONT | |
AltRepBackLayer | String | IV_ALTREP_BACK | |
UnconsumedSketchesLayer | String | IV_UNCONSUMED_SKETCHES | |
TangentRollLinesLayer | String | IV_ROLL_TANGENT | |
RollLinesLayer | String | IV_ROLL | |
- |
AcadVersion | String | | 2018, 2013, 2010, 2007, 2004, 2000 or R12 |
CustomizeFilename | String | | |
ExportUnconsumedSketchProperties | Boolean | False | False = to the layer UnconsumedSketchesLayer |
SimplifySplines | Boolean | True | Replace spline with straight segments |
SplineTolerance | Double | 0.01 | Chord length when simplifying splines |
AdvancedLegacyExport | Boolean | True | |
MergeOuterContour | Boolean | False | legacy |
MergeProfilesIntoPolyline | Boolean | False | |
RebaseGeometry | Boolean | False | Move geometry to the 1st quadrant |
TrimCenterlinesAtContour | Boolean | False | Trim centerlines at the countour |
InvisibleLayers | String | | List of layers to make invisible, delimited with ";" |
An overview of codes for the "...LineType" parameters at the individual layers (see the note in the previous table and see the examples above):
Symbolic name |
Value (enum code) |
kChainLineType |
37644 |
kContinuousLineType |
37633 |
kCustomLineType |
37649 |
kDashDottedLineType |
37638 |
kDashedDoubleDottedLineType |
37645 |
kDashedHiddenLineType |
37641 |
kDashedLineType |
37634 |
kDashedTripleDottedLineType |
37647 |
kDefaultLineType |
37648 |
kDottedLineType |
37636 |
kDoubleDashDoubleDottedLineType |
37639 |
kDoubleDashedChainLineType |
37637 |
kDoubleDashedDottedLineType |
37646 |
kDoubleDashedTripleDottedLineType |
37640 |
kLongDashDottedLineType |
37642 |
kLongDashedDoubleDottedLineType |
37635 |
kLongDashTripleDottedLineType |
37643 |
If you need to create the config string conveniently, through an interactive dialog, you can use the standalone FlatPatternConfigBuilder utility by CAD Studio:
