Combine steps in one feature

Combine steps in one feature

Mustafa.Salaheldin
Collaborator Collaborator
121 Views
2 Replies
Message 1 of 3

Combine steps in one feature

Mustafa.Salaheldin
Collaborator
Collaborator

Hello
I am new to Inventor, and I want to combine multiple features in one node in the model browser.
I have created a clientfeature called DuPod Feature1, and I want all the following steps (from Work Point 2 until Split 1) to be merged under this node.
I am using Inventor 2026 and C# .Net 8.

MustafaSalaheldin_0-1757132554896.png

 


¯\_(ツ)_/¯
Let it work like a charm.

Mustafa Salaheldin


EESignature




Digital Integration Manager, DuPod

Facebook | Twitter | LinkedIn

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

Michael.Navara
Advisor
Advisor
Accepted solution

Hi @Mustafa.Salaheldin 

Here is the small example how to create ClientFeature.

Usually it is used for features created by API, not for manually created features.

 

 

void Main()
{
    var part = ThisApplication.ActiveDocument as PartDocument;

    var compDef = part.ComponentDefinition;

    //Assumes there are at least two surface bodies in the part
    var body1 = compDef.SurfaceBodies[1];
    var body2 = compDef.SurfaceBodies[2];

    //Crate model features which should be combined in ClientFeature
    var workPoint1 = compDef.WorkPoints.AddFixed(
        ThisApplication.TransientGeometry.CreatePoint(0, 0, 0)
    );
    var workPoint2 = compDef.WorkPoints.AddFixed(
        ThisApplication.TransientGeometry.CreatePoint(0, 0, 0.5)
    );

    var workAxis1 = compDef.WorkAxes.AddByTwoPoints(workPoint1, workPoint2);

    //Keep input work points at the root of the model tree.
    workAxis1.ConsumeInputs = false;

    var workPlane1 = compDef.WorkPlanes.AddByLineAndPoint(workAxis1, workPoint2);

    var toolBodies = ThisApplication.TransientObjects.CreateObjectCollection();
    toolBodies.Add(body2);
    var combineFeature1 = compDef.Features.CombineFeatures.Add(body1, toolBodies, PartFeatureOperationEnum.kJoinOperation);

    var body3 = combineFeature1.SurfaceBody;
    var splitFeature1 = compDef.Features.SplitFeatures.SplitBody(workPlane1, body3);

    //Create ClientFeature
    var clientFeatureDefinition = compDef.Features.ClientFeatures.CreateDefinition(
        "SampleFeature",
        workPoint1,
        splitFeature1,
        null
    );
    compDef.Features.ClientFeatures.Add(clientFeatureDefinition, "YOUR-ADDIN-CLSID-GUID-HERE");
}

 

Message 3 of 3

mustafa_bakrE8NT7
Explorer
Explorer

Thanks @Michael.Navara 

0 Likes