AnsweredAssumed Answered

How to get the components from a Feature Folder or Component pattern

Question asked by Andreas Killer on Aug 12, 2016
Latest reply on Aug 15, 2016 by Andreas Killer

I've written a tool to set colors in an Assembly for a colored drawing in SW2016 SP3.

This thread is based on my previous one here.


In the attached Zip file is a reduced code, supports a few main macros:
Color_Blue, Color_Red, Color_Green, Color_Remove


The basic is to get the Feature from whatever is selected anywhere, then get the Entity, finally get the Component and set the color inside the assembly (see picture). Works pretty good in most cases.


You can select a face, edge in the drawing area or feature, part, sub assembly in the feature manager and call one of the color macros, works, the colors are applied as shown in this picture:



But when you select the Feature folder or the Mirror feature it doesn't work. My code gets all the Features, get the Entity, but Entity.GetComponent always returns nothing!


How can I get the Component to set my color in this case?


Regards, Andreas.