AnsweredAssumed Answered

Hide all sketches EXCEPT routing ones?

Question asked by Madson Germano on Dec 19, 2018

Hi SWers,

 

I was writing a macro to hide all sketches in a assembly (all sub assy are virtual components), based on this one:

2018 SOLIDWORKS API Help - Traverse Assembly and Hide All Sketches Example (VBA)

But with some additional options, like ignoring 3D route sketches.

 

At Sub TraverseComponent(), I tried to add:

For i = 0 To UBound(vChildComp)

            Set swChildComp = vChildComp(i)

            swCompIDString = swChildComp.GetSelectByIDString

            boolstatus = swModelDocExt.SelectByID2("Rota1@" & swCompIDString, "ROUTEFABRICATED", 0, 0, 0, False, 0, Nothing, 0)

            If Not (bExclRt = True And boolstatus = True) Then ...

 

This method of select by id worked in my other macro do rebuild routes, but it's not working in this one.

Not only it's hiding all sketches, but each sketch are counted twice...

 

Any thoughts?

 

Outcomes