CAD Forum - tips, tricks, discussion and utilities for AutoCAD, Inventor, Revit and other Autodesk products []
CZ | EN | DE
Login or
  Visitors: 8731
Plex.Earth connects AutoCAD and Google Earth

CAD tip CAD tip # 12392:

Question CAD 
 %  platform  category 
Q - question

Export unfolds of sheetmetal parts to DXF - parameters for iLogic and VBA

A - answer 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" _
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):

TangentLayer StringIV_TANGENT
OuterProfileLayer StringIV_OUTER_PROFILE 
ArcCentersLayer StringIV_ARC_CENTERS 
InteriorProfilesLayer StringIV_INTERIOR_PROFILES 
BendLayer StringIV_BENDBendUpLayer + BendDownLayer (legacy)
BendUpLayer StringIV_BEND 
BendDownLayer StringIV_BEND_DOWN 
ToolCenterLayer StringIV_TOOL_CENTERToolCenterUpLayer + ToolCenterDownLayer (legacy)
ToolCenterUpLayer StringIV_TOOL_CENTER 
ToolCenterDownLayer StringIV_TOOL_CENTER_DOWN 
FeatureProfilesLayer StringIV_FEATURE_PROFILESFeatureProfilesUpLayer + FeatureProfilesDownLayer (legacy)
FeatureProfilesUpLayer StringIV_FEATURE_PROFILES 
AltRepFrontLayer StringIV_ALTREP_FRONT 
AltRepBackLayer StringIV_ALTREP_BACK 
UnconsumedSketchesLayer StringIV_UNCONSUMED_SKETCHES 
TangentRollLinesLayer StringIV_ROLL_TANGENT 
RollLinesLayer StringIV_ROLL 
AcadVersion String 2018, 2013, 2010, 2007, 2004, 2000 or R12
CustomizeFilename String  
ExportUnconsumedSketchPropertiesBooleanFalseFalse = to the layer UnconsumedSketchesLayer
SimplifySplines BooleanTrueReplace spline with straight segments
SplineTolerance Double0.01Chord length when simplifying splines
AdvancedLegacyExport BooleanTrue 
MergeOuterContour BooleanFalselegacy
RebaseGeometry BooleanFalseMove geometry to the 1st quadrant
TrimCenterlinesAtContourBooleanFalseTrim centerlines at the countour
InvisibleLayers StringList 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:

100% *  CAD 
7.10.2019    7915×  
Prices - CAD eShop:
applies to: Inventor ·

See also:
Tip 12416:How to export DXF outline of unfolded sheetmetal in Fusion 360, with no bending lines.
Tip 11720:How to export unfolded sheetmetal parts in Fusion 360?

Back   All CAD Tips

Have we helped you? If you want to support the CAD Forum web service, consider buying one of our CAD applications, or our custom software development offerings, or donating via PayPal (see above). You may also add a link to your web - like this "fan" link: CAD Forum - tips, utilities, blocks for Autodesk products
CAD:    OS:    Categ: 
Text:  FAQ glossary   

Increase your productivity with our set of add-on functions for AutoCAD Civil 3D
CADstudio Civil Tools More info

Please use these tips at your own risk.
Arkance Systems is not responsible for possible problems that may occur as a result of using any of these tips.