ClientFeatures in Assemblies & Participants

ClientFeatures in Assemblies & Participants

Tom_Fuller
Contributor Contributor
496 Views
3 Replies
Message 1 of 4

ClientFeatures in Assemblies & Participants

Tom_Fuller
Contributor
Contributor

Looking through the API reference manual I can see that you can remove a participant from a ClientFeature object, but i can't seem to find anything on how to add a participant. 

 

I've tried using the AddDependency method on the ClientFeatureDefinition object, but that doesn't work

 

Anyone have any ideas?

0 Likes
Accepted solutions (1)
497 Views
3 Replies
Replies (3)
Message 2 of 4

WCrihfield
Mentor
Mentor

Hi @Tom_Fuller.  This is a pretty interesting post.  I do not use ClientFeatures myself, but this seems to be an anomaly type of situation having to do with 'derived Class' methods/properties.  Similar to how both the AssemblyComponentDefinition & PartComponentDefinition have the Occurrences property which is to return a ComponentOccurrences collection, even though parts do not have ComponentOccurrences in them.  This is because both of those 'Classes' are derived from the base 'ComponentDefinition' Class which has that property.  In this case the 'ClientFeature' Class is derived from the 'PartFeature' Class, and therefore it still contains the 'RemoveParticipant' Method and 'Participants' Property that are present in the PartFeature Class.  Plus, when you look at the 'Features' Property of an AssemblyComponentDefinition, it states that "The API does not yet support addition of assembly features.", which seems to be only partially true.  That paired with the ClientFeatures collection not seeming to have a way to create a new one that is meant for being used in the context of an assembly (no way to specify which ComponentOccurrence objects that you want it to effect), leads me to believe that there may either be another Type of object similar to this one that is meant for use in the context of an assembly, or maybe they simply have not added the ability to create one for use in an assembly yet.  For instance, the ExtrudeFeature Class, even though it too is derived from the PartFeature Class, it has the additional method named AddParticipant, but the ClientFeature Class does not.  Just my untested theory/thoughts on the subject.

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

0 Likes
Message 3 of 4

Tom_Fuller
Contributor
Contributor

I am inclined to agree with you, I do remember getting a NotImpletmentedException when I initially tried to create the ClientFeatureDefinition, which may imply that they intended to add the functionality, but ultimately didn't.

 

These observations would also fit with this PowerPoint presentation I found deep in the forums from 2007, annoyingly I can't find the original post, where one of the last slides points out possible future enhancements.

 

Which leads me to my next point, what should we do now? if I put this forward as an idea to add the functionality, how likely is it that it will actually be considered?

 

Edit: I've found the original post, where @philippe.leefsma posted a zip file containing the PowerPoint I attached (creating custom feature - Autodesk Community - Inventor) 

 

Here is the link to the idea, any support is greatly appreciated:
ClientFeature for Assemblies - Autodesk Community

0 Likes
Message 4 of 4

Tom_Fuller
Contributor
Contributor
Accepted solution

So I have figured it out. It seems like the ClientFeature object's Participants property is actually a collection of the participants from the nested PartFeature objects. This explains why you are able to remove participants, but not add them. I'd assume (I haven't tried this yet) that invoking the RemoveParticipant method on the ClientFeature will remove the participant from the nested features.

 

It would still be nice to have the ability to add participants directly to a ClientFeature though. There maybe scenarios that you'd want a sort of "Dummy" feature