Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.
hayattangercekler2
497 Views, 4 Replies

Triangle extrude production with inventor api c#

I want to make a triangular extrude + cut on an object with the inventor api. I use these codes for this, but "Profiles.AddForSolid();" I'm getting the "parameter incorrect" error in the function. How can I fix this error or is there a different extrude operation for the triangle?

error :

hayattangercekler2_0-1668175480021.png

 

            PlanarSketch osketch = compDef.Sketches.Add(compDef.WorkPlanes[3]);

            TransientGeometry tg = _application.TransientGeometry;
            Inventor.SketchPoints points = osketch.SketchPoints;

 
            Inventor.SketchLines lines = osketch.SketchLines;


            Inventor.SketchLine line1;
            Inventor.SketchLine line2;
            Inventor.SketchLine line3;
            line1 = lines.AddByTwoPoints(tg.CreatePoint2d(0, 0), tg.CreatePoint2d(0, 40));
            line2 = lines.AddByTwoPoints(tg.CreatePoint2d(0, 40), tg.CreatePoint2d(40, 40));
            line3 = lines.AddByTwoPoints(line2.EndSketchPoint, line1.StartSketchPoint);

           

            Profile oProfile = osketch.Profiles.AddForSolid();





            ExtrudeDefinition oExtrudeDef = compDef.Features.ExtrudeFeatures.CreateExtrudeDefinition(oProfile, PartFeatureOperationEnum.kCutOperation);

            oExtrudeDef.SetDistanceExtent(4, PartFeatureExtentDirectionEnum.kSymmetricExtentDirection);

            ExtrudeFeature oExtrude = compDef.Features.ExtrudeFeatures.Add(oExtrudeDef);