Message 1 of 5
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi,
I want to split a BoundaryPatch with a SketchLine in C# in Inventor Professional 2021.1.2 Build 245.
I've tried with SplitFeatures.SplitBody:
- SketchLine3D with a SurfaceBody
- Create a Path from the SketchLine3D and then with a SurfaceBody
I've also tried with SplitFeatures.SplitFaces to no avail.
This works manually in the UI. But I don't get it to work in code. How do I create a Path object correctly?
See attached code and part.
Code in short also here:
var componentDefinition = sketch3D.Parent as ComponentDefinition;
var partComponentDefinition = sketch3D.Parent as PartComponentDefinition;
var splitFeatures = partComponentDefinition.Features.SplitFeatures;
SketchLine3D line = sketch3D.SketchLines3D[5];
SurfaceBody surfBody = partComponentDefinition.WorkSurfaces[1].SurfaceBodies[1];
// Try directly with SketchLine3D
try
{
splitFeatures.SplitBody(line, surfBody);
}
catch (Exception) { }
// Try creating a Path
try
{
var path = partComponentDefinition.Features.CreatePath(line);
splitFeatures.SplitBody(path, surfBody);
}
catch (Exception) { }
Many thanks in advance!
Solved! Go to Solution.