Get Solid Body with Sculpt Feature

Get Solid Body with Sculpt Feature

ga42bon
Contributor Contributor
506 Views
2 Replies
Message 1 of 3

Get Solid Body with Sculpt Feature

ga42bon
Contributor
Contributor

Hello everybody,

 

I'm trying to convert my SurfaceBody/NonParametricBaseFeature into a solid body. My idea is to use a SculptFeature as this works already manually.

 

You can see the feature to convert in the screenshot down below.

220521-Wochenbericht KW21 - Inventor Forum - Surface Body to Solid.JPG

 

 

The code to get this feature into my PartDocument is here:

' Get the source document
Dim oSourceAsmDoc As AssemblyDocument = g_inventorApplication.ActiveDocument

' Get the Interference Body.
Dim oIntBody As SurfaceBody = oCollision.oIntBody

' Copy the face as a transient B-Rep face.
Dim oNewBody As SurfaceBody = g_inventorApplication.TransientBRep.Copy(oIntBody)

' Add the body to the existing gripper jaw document
Dim oTargetPartDoc As PartDocument = g_inventorApplication.Documents.Item(3)

' Create a non-parametric base feature using the face as a transition to get rotated face
Dim oTransitionNPFeature As NonParametricBaseFeature = oTargetPartDoc.ComponentDefinition.Features.NonParametricBaseFeatures.Add(oNewBody)

 I copied an interference body from an assembly document to a part document using an adaption of the following issue: https://forums.autodesk.com/t5/inventor-ilogic-and-vb-net-forum/transformation-of-surfacebody-copy-d...

 

My idea to use a SculptFeature is based on the following steps done manually ("Formen" is german for Sculpt):

"Formen" is german for Sculpt"Formen" is german for Sculpt

 

The result of Sculpt -> New Body  is a solid bodyThe result of Sculpt -> New Body is a solid body

 

I already tried to write these steps in Visual Basic:

' Creat sculpt surface collection
Dim SurfCol As ObjectCollection = g_inventorApplication.TransientObjects.CreateObjectCollection
        SurfCol.Add(oTransitionNPFeature)

' Create a sculpt feature; convert SurfaceBody to Solid
Dim oSculptFeature As SculptFeature = oDoc.ComponentDefinition.Features.SculptFeatures.Add(SurfCol, PartFeatureOperationEnum.kNewBodyOperation)

The problem is the input of the SculptFeature.Add Method. I couldn't the right solution what to type as an input for this method yet.

I've tried the following:

  1. CreateSculptSurface -> Error with input (oNewBody or oTransitionNPFeature)
  2. Add -> Error with input (oNewBody or oTransitionNPFeature)
  3. First creating a surface collection and use the method Add -> same Error with input

 

Is there a way to convert this SurfaceBody or NonParametricBaseFeature into a Solid? Preferably with the method SculptFeature.Add?

 

I would be very happy to receive some help with this issue.

Thank you!

 

Sebastian

 

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

JelteDeJong
Mentor
Mentor
Accepted solution

You might want to have a look at this post. There I wrote a rule that creates a solid box using a "NonParametricBaseFeature". Maybe you can use that rule as an example.

Jelte de Jong
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature


Blog: hjalte.nl - github.com

Message 3 of 3

ga42bon
Contributor
Contributor

Thanks a lot! @JelteDeJong 

 

With some lines of code in this post I could turn my NonParametricBaseFeature into solid.

0 Likes