Single laser line in save as... *.dxf

Single laser line in save as... *.dxf

Anonymous
Not applicable
613 Views
4 Replies
Message 1 of 5

Single laser line in save as... *.dxf

Anonymous
Not applicable

Hello all,

 

I'm working on auto generate pdf/dxf for inventor files with iLogic. For so far it's creating pdf and dxf as I wanted it to create, the difficulty was in the creation of dxf with the *.ini file and layers visible and invisible. But it works fine now. The thing is that the sometimes I want to have a single laser line in the *.dxf. I've found a work around of creating this with editing the flat pattern; made a extrusion and over that extrusion a sketch; with creating *.dxf I made the 'IV_UNCONSUMED_SKETCHES:Visibility=ON' so it's visible on the dxf. Problem solved I thought.

 

Now I get the product in my hand and the single laser line isn't cut 😞 the thing is that it is in a different layer (in the *.dxf file) so the laser program did not used it for its program. So I can asked the laser machine man to pay attention on the different layers or what I thing should be a better solution to let Inventor Merge the unconsumed sketches with Interior_Profile layer. This is possible with AutoCAD Mechanical so I hope Inventor can do this to in its save copy as... *.dxf.

 

Please let my know if you know how this is possible.

 

Best Regards,

 

Bram

Capture2.JPG

 

0 Likes
Accepted solutions (1)
614 Views
4 Replies
Replies (4)
Message 2 of 5

frederic.vandenplas
Collaborator
Collaborator

Hi, 

 

This is my code for exporting to dxf, which may help you in the right direction.

 

This is my code (vb.net) , the only thing that may cause problems is this:

SplineTolerance=0,01 --> possible 0.01 instead of 0,01
 Private Sub SMExport_OnExecute(Context As NameValueMap) Handles SMExport.OnExecute

            Try

            Dim oIamDoc As AssemblyDocument = InvApp.ActiveDocument
            Dim oIamCompDef As AssemblyComponentDefinition = oIamDoc.ComponentDefinition
            Dim oRefDocs As DocumentsEnumerator = oIamDoc.AllReferencedDocuments

            For Each oRefDoc As Document In oRefDocs
                If oRefDoc.SubType = "{9C464203-9BAE-11D3-8BAD-0060B0CE6BB4}" Then
                    If LCase(Trim(oRefDoc.PropertySets.Item("Inventor Summary Information").Item("Subject").Value)) <> "no" Then
                        Dim oDoc As PartDocument = InvApp.Documents.ItemByName(oRefDoc.FullFileName)
                        Dim oOccs As ComponentOccurrencesEnumerator = oIamCompDef.Occurrences.AllReferencedOccurrences(oDoc)

                        oDoc = InvApp.Documents.Open(oRefDoc.FullFileName, True)
                        If oDoc.ComponentDefinition.HasMultipleSolidBodies = False Then
                            Dim strMaterial As String = oDoc.ActiveMaterial.DisplayName
                            Dim strTotalFileName As String = InvApp.DesignProjectManager.ActiveDesignProject.WorkspacePath & "\2D\Laser\" & oRefDoc.PropertySets.Item("Design Tracking Properties").Item("Part Number").Value & " " & oDoc.ComponentDefinition.Parameters("Thickness").Value * 10 & "mm" & " " & oDoc.ActiveMaterial.DisplayName & " " & oOccs.Count & "st.dxf"

                            Dim oDataIO As DataIO = oDoc.ComponentDefinition.DataIO
                            oDataIO.WriteDataToFile("FLAT PATTERN DXF?AcadVersion=R12&SimplifySplines=True&MergeProfilesIntoPolyline=True&SplineTolerance=0,01&UnconsumedSketchesLayer=UnConsumedSketchesLayer&OuterProfileLayer=OuterProfile&InteriorProfilesLayer=InteriorProfile&AltRepFrontLayer=AltRepFront&AltRepBackLayer=AltRepBack&InteriorProfilesLayer=UnconsumedSketch&TangentRollLinesLayer=TangentRoll&RollLinesLayer=Roll&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", strTotalFileName)
                            'oDataIO.WriteDataToFile("FLAT PATTERN DXF?AcadVersion=2000", strTotalFileName)
                        End If

                        InvApp.ActiveDocument.Close(True)
                    End If
                End If
                Next
            Catch ex As Exception
                MessageBox.Show(ex.ToString)
            End Try
        End Sub

 

If you think this answer fullfilled your needs, improved your knowledge or leads to a solution,
please feel free to "kudos"
Message 3 of 5

Anonymous
Not applicable

Hello Frederic,

 

Thanks for you reply, I've tried your 'mergeprofilesintopolylines' but I don't think I need that. In the picture below you see 2 lines close to each other, that 2 lines I would like to 'merge'into one line. I don't think thats the function of the mergeprofilesintopolylines...

 

Best Regards,

 

BramCapture3.JPG

0 Likes
Message 4 of 5

frederic.vandenplas
Collaborator
Collaborator

Aha, now i see, did you ever tried the cosmetic welding line? It may be a better solution?

I did not test if there is a seperate layer for that.

Part is attached (Inventor 2015)

 

If you think this answer fullfilled your needs, improved your knowledge or leads to a solution,
please feel free to "kudos"
Message 5 of 5

Anonymous
Not applicable
Accepted solution

Thanks for your reply, I work here with inv2012 😞

 

But I found a solution for my problem: In the picture below I've made a sketch en made it visible so it would me seen in the dxf. Now in the dxf creation I gave UnconsumedSketchesLayer and InteriorProfilesLayer the same Layer name and now it works. 

 

 

sOut = "FLAT PATTERN DXF?AcadVersion=2004&OuterProfileLayer=IV_OUTER_PROFILE&UnconsumedSketchesLayerColor=0;0;0&UnconsumedSketchesLayer=IV_INTERIOR_PROFILES&InteriorProfilesLayer=IV_INTERIOR_PROFILES&InvisibleLayers=IV_TANGENT;IV_BEND;IV_BEND_DOWN;IV_ROLL_TANGENT;IV_ARC_CENTERS"

 

 

Untitled-1.jpg

 

0 Likes