Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Export bending angles via xData to dxf

0 REPLIES 0
Reply
Message 1 of 1
christian.brandstaetter
107 Views, 0 Replies

Export bending angles via xData to dxf

Greetings,
I am currently trying to export the bending angle information within my dxf-export routine,
but can't figure out a way to do it.
It sounds reasonable to use xData for that purpose. Has anyone an idea?
I considered saving the dxf and reopening it as text and then add my desired lines manually,
but i have no clue how to find my desired bendlines.

Here is my current routine exporting the dxf:
Sub
sheetmetal_export(oDoc, Dateiname) Logger.Info("init oSheet with oDoc.Sheets(1) as Inventor.Sheet") Dim oSheet As Inventor.Sheet oSheet = oDoc.Sheets(1) Logger.Info("init oView with oSheet.DrawingViews(1) as Inventor.DrawingView") Dim oView As Inventor.DrawingView oView = oSheet.DrawingViews(1) Logger.Info("init oRefDoc with oView.ReferencedDocumentDescriptor.ReferencedDocument") 'Dim oRefDoc As Inventor.Document oRefDoc = oView.ReferencedDocumentDescriptor.ReferencedDocument Logger.Info(" Check if Doc is of type sheet_metal") If oRefDoc.SubType = "{9C464203-9BAE-11D3-8BAD-0060B0CE6BB4}" Then Logger.Info(" True: Open Doc and activate") ThisApplication.Documents.Open(oRefDoc.FullDocumentName) oRefDoc.Activate() Logger.Info(" True: Check if sheet metal has flat pattern") Dim oFlatPattern As FlatPattern oFlatPattern = oRefDoc.ComponentDefinition.FlatPattern Dim oSheetMetalCompDef As ComponentDefinition oSheetMetalCompDef = oRefDoc.ComponentDefinition If oSheetMetalCompDef.HasFlatPattern = False Then Logger.Info(" True: False: unfold sheet metal") oSheetMetalCompDef.Unfold Else Logger.Info(" True: True: no action needed") End If Logger.Info(" True: Set thickness parameter for further use") thicknessParam = oSheetMetalCompDef.Thickness.Value *10 'change from [cm] to [mm] Logger.Info(" True: Set area parameter for further use") Dim areaParam As Double = oFlatPattern.MassProperties.Area Logger.Info(" True: Set weight parameter for further use") Dim massParam As Double = oFlatPattern.MassProperties.Mass Logger.Info(" True: Prepare for dxf export") Dim oDataIO As DataIO oDataIO = oRefDoc.ComponentDefinition.DataIO Dim sOut As String Logger.Info(" True: Define exprot schema") 'sOut definiert die Abwicklungsoptionen. siehe auch https://forums.autodesk.com/t5/inventor-ilogic-and-vb-net-forum/sheetmetal-export-dxf-flat-pattern-using-ilogic-with-custom/td-p/9118605 '&UnconsumedSketchesLayerLineType=0 & RebaseGeometry=True sOut = "FLAT PATTERN " & UCase("dxf") & "?AcadVersion=2004" & _ "&OuterProfileLayer=PROFILE&OuterProfileLayerLineType=37633&OuterProfileLayerLineWeight=0.0500&OuterProfileLayerColor=0;0;0" _ + "&ArcCentersLayer=ARC_CENTERS&ArcCentersLayerLineType=37633&ArcCentersLayerLineWeight=0.0500&ArcCentersLayerColor=255;0;0" _ + "&InteriorProfilesLayer=PROFILE&InteriorProfilesLayerLineType=37633&InteriorProfilesLayerLineWeight=0.0500&InteriorProfilesLayerColor=0;0;0" _ + "&BendUpLayer=BEND&BendUpLayerLineType=37633&BendUpLayerLineWeight=0.0500&BendUpLayerColor=0;255;0" _ + "&BendDownLayer=BEND_DOWN&BendDownLayerLineType=37634&BendDownLayerLineWeight=0.0500&BendDownLayerColor=0;255;0" _ + "&ToolCenterUpLayer=TOOL_CENTER&ToolCenterUpLayerLineType=37633&ToolCenterUpLayerLineWeight=0.0500&ToolCenterUpLayerColor=255;0;0" _ + "&ToolCenterDownLayer=TOOL_CENTER_DOWN&ToolCenterDownLayerLineType=37633&ToolCenterDownLayerLineWeight=0.0500&ToolCenterDownLayerColor=255;0;0" _ + "&FeatureProfilesUpLayer=FEATURES_UP&FeatureProfilesUpLayerLineType=37633&FeatureProfilesUpLayerLineWeight=0.0500&FeatureProfilesUpLayerColor=255;0;0" _ + "&FeatureProfilesDownLayer=FEATURES_DOWN&FeatureProfilesDownLayerLineType=37633&FeatureProfilesDownLayerLineWeight=0.0500&FeatureProfilesDownLayerColor=255;0;0" _ + "&AltRepFrontLayer=ALTREP_FRONT&AltRepFrontLayerLineType=37633&AltRepFrontLayerLineWeight=0.0500&AltRepFrontLayerColor=255;0;0" _ + "&AltRepBackLayer=ALTREP_BACK&AltRepBackLayerLineType=37633&AltRepBackLayerLineWeight=0.0500&AltRepBackLayerColor=255;0;0" _ + "&UnconsumedSketchesLayer=SKETCH&UnconsumedSketchesLayerLineWeight=0.0500&UnconsumedSketchesLayerColor=255;255;0" _ + "&RollLinesLayer=ROLL&RollLinesLayerLineType=37633&RollLinesLayerLineWeight=0.0500&RollLinesLayerColor=0;255;0" _ + "&InvisibleLayers=IV_TANGENT;TANGENT;ROLL_TANGENT;ARC_CENTERS;ROLL;ALTREP_BACK;ALTREP_FRONT;TOOL_CENTER_DOWN;TOOL_CENTER;FEATURES_UP;FEATURES_DOWN" ';BEND;BEND_DOWN" Logger.Info(" True: actual export") oDataIO.WriteDataToFile(sOut, Dateiname) Logger.Info(" True: Close oDoc") oRefDoc.Close() Else Logger.Info(" False: exit subroutine") Exit Sub End If End Sub

Any help is highly appreciated.
Tags (3)
Labels (3)
0 REPLIES 0

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report