Export single layer only from drawing to DXF within iLogic rule

Export single layer only from drawing to DXF within iLogic rule

andrew.tom.reynolds
Advocate Advocate
763 Views
3 Replies
Message 1 of 4

Export single layer only from drawing to DXF within iLogic rule

andrew.tom.reynolds
Advocate
Advocate

I have a rule that exports my sheet metal flat pattern drawing to DXF and that's all working as expected. The reason i'm doing it from the drawing is that they want all the flat patterns of a certain material type and thickness in one DXF with the parts set in the orientation according to their brush grain.

I have the bend line and symbols layers turned off in the drawing and in the DXF they still come in but on a frozen layer so whilst they are not visible, they are still there.

To remove any risk of the laser machine operator accidentally turning these back on and cutting them, I would like to be able to export only say the "Visible" layer from the drawing to the DXF and not have any other layers export at all.

Does anyone know if this is even possible? And if so, i'm currently using the TranslatorAddIn / SaveCopyAs method... Any idea of the options that would need to be set / example code?

Thanks!!

0 Likes
Accepted solutions (1)
764 Views
3 Replies
Replies (3)
Message 2 of 4

chandra.shekar.g
Autodesk Support
Autodesk Support
Accepted solution

@andrew.tom.reynolds ,

 

Hoping that making invisible lines would help to export single layers to dxf. Below iLogic code can be used to make invisible drawing curves. After hiding, you can export left drawing curves to dxf.

 

Sub Main()
    Dim oDoc As DrawingDocument
    oDoc = ThisApplication.ActiveDocument
    
    Dim oSheet As Sheet
    oSheet = oDoc.ActiveSheet
    
    Dim oView As DrawingView
    oView = oSheet.DrawingViews.Item(1)
    
    Dim oCurve As DrawingCurve
    For Each oCurve In oView.DrawingCurves
        Dim oSegment As DrawingCurveSegment
        For Each oSegment In oCurve.Segments
            If oSegment.Layer.Name <> "Visible (ISO)" Then
                 oSegment.Visible = False
            End If
        Next
    Next
End Sub

Thanks and regards,


CHANDRA SHEKAR G
Developer Advocate
Autodesk Developer Network



0 Likes
Message 3 of 4

andrew.tom.reynolds
Advocate
Advocate

Perfect! Thanks @chandra.shekar.g 

0 Likes
Message 4 of 4

chandra.shekar.g
Autodesk Support
Autodesk Support

@andrew.tom.reynolds 

 

You are welcome!!!

 

Thanks and regards,


CHANDRA SHEKAR G
Developer Advocate
Autodesk Developer Network



0 Likes