Hi @claudio.ibarra. I just got back after the holiday weekend. I am glad to hear that you now have a code solution that is working OK for you. However, I would like to add a couple more tips about that code that may help make it even better. Since that code is going to be used as an internal rule (instead of an external rule), then I would suggest that you switch from using the 'ThisApplication.ActiveDocument' phrase, to using the 'ThisDoc.Document' phrase, because that second term was designed specifically for representing the document that the rule is saved within. That first term just points to whatever document happens to be 'active' (visibly open/editing on your screen) at the moment the rule is ran. That is OK when you have that part visibly open for editing on your screen at the time, but if an assembly, containing that part, is the 'active' document, and that rule gets triggered to run, it will be trying to act upon the assembly, instead of the part, if the rule is looking at ThisApplication.ActiveDocument.
And if you switch to using the 'ThisDoc.Document' phrase, you might as well also switch from using 'iLogicVb.Automation.GetNamedEntities()', to using 'ThisDoc.NamedEntities', because that phrase is already referring to the same, local document. It's just a slightly simpler way to do the same thing in situations like this. I also generally prefer to use the 'TryGetEntity' method, instead of the 'FindEntity' method, just because it is a newer method that will not throw an error if the named entity is not found. However, when using that, I usually also include an additional line of code that just checks to make sure that the face was actually found, before proceeding. If this were a longer routine, I might also suggest that you get the two different Asset objects (*Blue & active one) to 2 variables ahead of time, instead of retrieving them both twice (once for each line setting it as a value), but that is just a very minor performance related detail.
I attached a text file containing a slightly edited copy of that last code you posted, which includes the changes I mentioned in my comments above, just in case you may want to review it.
Wesley Crihfield

(Not an Autodesk Employee)