- 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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
@Anonymous Yes. We use SplitFeatures.SplitFaces.
Some C#-like pseudocode:
Path path = PartFeatures.CreatePath(SketchLine3D);
var objColl = TransientObjects.CreateObjectCollection();
objColl.Add(SurfaceBody.Faces[1]);
var split = splitFeatures.SplitFaces(path, false, objColl);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
do happen to have any completed addins or ilogic code to share in regards to this?
I am about to embark on working on this and could potentially save days of research and work.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
@Anonymous No, sorry. I don't know iLogic and our full C# code is private.
You could use the SimpleAddIn and start from there. If you installed the DeveloperTools, it should be at C:\Users\Public\Documents\Autodesk\Inventor 2022\SDK\DeveloperTools\Samples\VCSharp.NET\AddIns\SimpleAddIn
I guess you already know where to look for the API anyway, but here is a link to the PartFeatures.