Hide drawingView lines of a part's feature withing the view's assembly

Hide drawingView lines of a part's feature withing the view's assembly

a.pournaras
Explorer Explorer
144 Views
1 Reply
Message 1 of 2

Hide drawingView lines of a part's feature withing the view's assembly

a.pournaras
Explorer
Explorer

Hello all,

 

I would like to hide all lines of specific features of a part that lies within the view's assebly. How could I achieve this?

Manualy it can be done by selecting the features in question and by right clicking them i can "mark" them and they become green. After that, by right clicking on them on the drawingView (the now green lines) i can select the option to hide them.

 

I found the "DrawingSelectFeatureCmd" comand from the available comands of ControlDefinition which I suppose does the first part of the manual way but, provided I am correct about that, how can I then "right-click" them and hide them?

 

I know that I can achieve the same visual result by creating a new visual representation of the part in question and suppress these features and then another one in the assmbly that uses that representation  instead of the one that these features are not suppressed but that way will break alot of my code so I would prefer not to go that route.

 

Thank you in advance!

0 Likes
145 Views
1 Reply
Reply (1)
Message 2 of 2

WCrihfield
Mentor
Mentor

Hi @a.pournaras.  That would be a relatively complex task to automate completely by code.  Most things are far simpler to do manually, than they are to do by code, but this one is rather extreme difference in complexity.  One of the main tools you would need to use is the DrawingView.DrawingCurves property, which works like a Function. But in order to use it, you will need to dig down into your assembly, to the component representing that part, then into that part to get a reference to that specific feature to a variable.  Then you will need to get the top level proxy copy of that feature that exists within the context of the main assembly.  Then you will need to provide that proxy feature to that DrawingCurves property, as input, and it will retrieve the set of geometry that exists within that view (if any) that is representing that feature.  Then you will need to iterate through each piece of geometry in that collection, and turn its visibility off.  There is not really much available as far as shortcuts for a task like this.

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

0 Likes