Message 1 of 5
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
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 :
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);
Solved! Go to Solution.