Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

ClientFeature.AddDependency

0 REPLIES 0
Reply
Message 1 of 1
Anonymous
213 Views, 0 Replies

ClientFeature.AddDependency

Hello, 

I am trying to implement a clientfeature that needs to update when the geometry it references updates, 

from what i understand i need to set IsCustomSolved = true, and set its dependency to the reference geometry by using ClientFeature.Definition.AddDependency()

 

when i try to call AddDependency() i get a an ArgumentException when i pass it a sketch/work axis etc.

 

        public static void Main()
        {
            var app = (Inventor.Application)System.Runtime.InteropServices.Marshal.GetActiveObject("Inventor.Application");
            var doc = (AssemblyDocument)app.ActiveDocument;
            var def = doc.ComponentDefinition;
            var sketch = def.Sketches[1];
            
            var clientfeaturedef = def.Features.ClientFeatures.CreateDefinition("TestFeature");
            clientfeaturedef.IsCustomSolved = true;
            var clientFeature = def.Features.ClientFeatures.Add(clientfeaturedef, "someid");
            clientFeature.Definition.AddDependency(sketch);
        }

 am i doing something wrong here?

0 REPLIES 0

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report