Macro or iLogic to Select Drawing edges

Macro or iLogic to Select Drawing edges

Anonymous
Not applicable
786 Views
2 Replies
Message 1 of 3

Macro or iLogic to Select Drawing edges

Anonymous
Not applicable

Hello,

 

I am looking for a Macro or ilogic to select and turn off the visibility of the edges in the particular layer or all the visible edges in the drawing file. (Without Turn off the Layer).

 

Thanks Beforehand.

0 Likes
Accepted solutions (2)
787 Views
2 Replies
Replies (2)
Message 2 of 3

JamieVJohnson2
Collaborator
Collaborator
Accepted solution

For Each dc As DrawingCurve In vEnd.DrawingCurves(skProfile)

       Dim modObj As Object = dc.ModelGeometry
                If TypeOf modObj Is SketchLine Then
                    Dim skLine As SketchLine = modObj

'do tests to verify line is what you want, if you want to turn off then:

                        For Each dcs As DrawingCurveSegment In dc.Segments
                            dcs.Visible = False
                        Next

                end if

next

Jamie Johnson : Owner / Sisu Lissom, LLC https://sisulissom.com/
Message 3 of 3

dgreatice
Collaborator
Collaborator
Accepted solution

Hi,

 

try this:

 

Dim oApp As Application
Dim oDD As DrawingDocument
Dim oSht As Sheet
Dim oDV As DrawingView
Dim oDC As DrawingCurve
Dim oDCS As DrawingCurveSegment
Dim oLayer As String

oApp = ThisApplication
oDD = oApp.ActiveDocument
oSht = oDD.ActiveSheet
oLayer = "Hidden (ISO-2)" 'Change this

For Each oDV In oSht.DrawingViews
    For Each oDC In oDV.DrawingCurves
        For Each oDCS In oDC.Segments
            If oDCS.Layer.Name = oLayer Then
                oDCS.Visible = False
            End If
        Next
    Next
    
Next
 

 

Please use the ACCEPT AS SOLUTION or KUDOS button if my Idea helped you to solve the problem.

Autodesk Inventor Professional Certified 2014