String format Export to DXF

String format Export to DXF

dominiek_vanwest
Advocate Advocate
1,491 Views
5 Replies
Message 1 of 6

String format Export to DXF

dominiek_vanwest
Advocate
Advocate

Hi,

 

I'm not exactly sure how to build the string that defines the format of the DXF file.

Here below and example:

Dim sOut As String
    sOut = "FLAT PATTERN DXF?AcadVersion=2004&OuterProfileLayer=Outer&InvisibleLayers=IV_Tangent;IV_Bend;IV_Bend_Down;IV_Bend_Up;IV_Arc_Centers"

 

 

And here below what is in my *.ini file:

[FP EXPORT SELECT OPTIONS]
AUTOCAD VERSION=AutoCAD 2000
USE CUSTOMIZE=No
CUSTOMIZE FILE=c:\program files\autodesk\inventor 2013\Design Data\DWG-DXF\FlatPattern.xml
[FLATPATTERN LAYER OPTIONS]
Tangent Lines=IV_TANGENT:Visibility=OFF;LinePattern=28100;LineWeight=0,0500;Color=0,0,0;
Bend Lines (Front)=IV_BEND:Visibility=ON;LinePattern=28100;LineWeight=0,0500;Color=0,255,0;
Bend Lines (Back)=IV_BEND_DOWN:Visibility=ON;LinePattern=28100;LineWeight=0,0500;Color=0,0,0;
Tool Centers (Front)=IV_TOOL_CENTER:Visibility=OFF;LinePattern=28100;LineWeight=0,0500;Color=0,0,0;
Tool Centers (Back)=IV_TOOL_CENTER_DOWN:Visibility=OFF;LinePattern=28100;LineWeight=0,0500;Color=0,0,0;
Arc Centers=IV_ARC_CENTERS:Visibility=OFF;LinePattern=28100;LineWeight=0,0500;Color=0,0,0;
Outer Profile=IV_OUTER_PROFILE:Visibility=ON;LinePattern=28100;LineWeight=0,0500;Color=0,0,0;
Inner Profile=IV_INTERIOR_PROFILES:Visibility=ON;LinePattern=28100;LineWeight=0,0500;Color=0,0,0;
Feature Profile (Front)=IV_BEND:Visibility=ON;LinePattern=28100;LineWeight=0,0500;Color=0,255,0;
Feature Profile (Back)=IV_FEATURE_PROFILES_DOWN:Visibility=OFF;LinePattern=28100;LineWeight=0,0500;Color=0,0,0;
Alternate Rep (Front)=IV_ALTREP_FRONT:Visibility=OFF;LinePattern=28100;LineWeight=0,0500;Color=0,0,0;
Alternate Rep (Back)=IV_ALTREP_BACK:Visibility=OFF;LinePattern=28100;LineWeight=0,0500;Color=0,0,0;
Unconsumed Sketches=IV_UNCONSUMED_SKETCHES:Visibility=OFF;LinePattern=0;LineWeight=-1,0000;Color=-255,-255,-255;
Tangent Roll Lines=IV_ROLL_TANGENT:Visibility=OFF;LinePattern=28100;LineWeight=0,0500;Color=0,0,0;
Roll Lines=IV_ROLL:Visibility=OFF;LinePattern=28100;LineWeight=0,0500;Color=0,0,0;
[FLATPATTERN GEOMETRY OPTIONS]
REBASE GEOMETRY=No
GROUP GEOMETRY=Yes
REPLACE SPLINE=No
SPLINE SIMPLIFICATION METHOD=Linear
CHORD_TOLERANCE=0,010

How do I adjust the String (sOut), so all the info above is in there?

 

 

Thanks in advance,

Dominiek

0 Likes
Accepted solutions (1)
1,492 Views
5 Replies
Replies (5)
Message 2 of 6

Owner2229
Advisor
Advisor

This is what I'm using:

 

 

Dim oDoc As Document = ThisApplication.ActiveDocument
Dim oSMCD As SheetMetalComponentDefinition = oDoc.ComponentDefinition
Dim sOut As String sOut = "FLAT PATTERN DXF?AcadVersion=2000" _ + "&OuterProfileLayer=IV_INTERIOR_PROFILES" _ + "&InvisibleLayers=IV_TANGENT;IV_FEATURE_PROFILES_DOWN" _ + "&SimplifySplines=True" _ + "&BendLayerColor=255;255;0" _ + "&BendUpLayerColor=255;255;0" _ + "&BendDownLayerColor=255;255;0" _ + "&FeatureProfilesLayerColor=255;255;0" _ + "&FeatureProfilesUpLayerColor=255;255;0" _ + "&UnconsumedSketchesLayerColor=255;255;0" + "&BendLayerLineType=37634" _ + "&BendUpLayerLineType=37634" _ + "&BendDownLayerLineType=37634" _ + "&FeatureProfilesLayerLineType=37634" _ + "&FeatureProfilesUpLayerLineType=37634" _ + "&UnconsumedSketchesLayerLineType=37634" _ + "&FeatureProfilesDownLayerLineType=37634" _ + "&FeatureProfilesDownLayerColor=255;255;0" _ sPath = "C:\File.DXF" oSMCD.DataIO.WriteDataToFile( sOut, sPath)

 

Consider using "Accept as Solution" / "Kudos" if you find this helpful.
- - - - - - - - - - - - - - -
Regards,
Mike

"Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live." - John F. Woods
0 Likes
Message 3 of 6

dominiek_vanwest
Advocate
Advocate

@Owner2229 wrote:

This is what I'm using:

 

 

Dim oDoc As Document = ThisApplication.ActiveDocument
Dim oSMCD As SheetMetalComponentDefinition = oDoc.ComponentDefinition
Dim sOut As String sOut = "FLAT PATTERN DXF?AcadVersion=2000" _ + "&OuterProfileLayer=IV_INTERIOR_PROFILES" _ + "&InvisibleLayers=IV_TANGENT;IV_FEATURE_PROFILES_DOWN" _ + "&SimplifySplines=True" _ + "&BendLayerColor=255;255;0" _ + "&BendUpLayerColor=255;255;0" _ + "&BendDownLayerColor=255;255;0" _ + "&FeatureProfilesLayerColor=255;255;0" _ + "&FeatureProfilesUpLayerColor=255;255;0" _ + "&UnconsumedSketchesLayerColor=255;255;0" + "&BendLayerLineType=37634" _ + "&BendUpLayerLineType=37634" _ + "&BendDownLayerLineType=37634" _ + "&FeatureProfilesLayerLineType=37634" _ + "&FeatureProfilesUpLayerLineType=37634" _ + "&UnconsumedSketchesLayerLineType=37634" _ + "&FeatureProfilesDownLayerLineType=37634" _ + "&FeatureProfilesDownLayerColor=255;255;0" _ sPath = "C:\File.DXF" oSMCD.DataIO.WriteDataToFile( sOut, sPath)

 


That's not for me right? That's just another example?

I'd like to know how the String is build. How can I convert the text in my *.ini file to the sOut String?

0 Likes
Message 4 of 6

Owner2229
Advisor
Advisor

I thought u want to write the parameters from the INI file to the code. You can't export Flatpattern with external INI. What I posted is an example of how to specify export options in "sOut" String.

 

Consider using "Accept as Solution" / "Kudos" if you find this helpful.
- - - - - - - - - - - - - - -
Regards,
Mike

"Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live." - John F. Woods
0 Likes
Message 5 of 6

dominiek_vanwest
Advocate
Advocate
Accepted solution

Yes, you posted an example of the export options, but that's not the whole thing. What is what is not clear.

 

In the meantime I have found it: https://forums.autodesk.com/t5/inventor-customization/export-dxf-options/td-p/5616756

In one of those posts of that link there is a pdf how to make the output string. I have also attached it here.

0 Likes
Message 6 of 6

C-Hoppen
Advocate
Advocate


In Inventor 2016 a new option "trim center lines" was added. What is the argument name for this new option? I would like to export with "trim center lines = true".

Thanks in advanced


Christoph

0 Likes