API support\limits: convert Solid to a surface in a part

API support\limits: convert Solid to a surface in a part

Anonymous
Not applicable
674 Views
2 Replies
Message 1 of 3

API support\limits: convert Solid to a surface in a part

Anonymous
Not applicable

I try to convert Solid to a surface in a part, I only succeed to open the next windows automatically (Thicken/Offset) as you can see in the image,

But I could not select surface option, and then OK button.

 

 

This is how I open the window automatically (Thicken/Offset): Dim oControlDef As ControlDefinition = Form1.appMain.CommandManager.ControlDefinitions.Item("PartThickenOffsetCmd") oControlDef.Execute()

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

Sergio.D.Suárez
Mentor
Mentor
Accepted solution

This is an ilogic rule that turns every face of a solid into a surface, maybe it can serve you.
Remember that you can export to iges to obtain brep surfaces.

 

Dim oPartDocument As Inventor.PartDocument
oPartDocument = ThisApplication.ActiveDocument

Dim oCompDef As Inventor.ComponentDefinition
oCompDef = oPartDocument.ComponentDefinition

Dim oSBodies As Inventor.SurfaceBodies
oSBodies = oCompDef.SurfaceBodies

Dim oSBody As Inventor.SurfaceBody
Dim oFace As Inventor.Face

Dim oThicken As ThickenFeature

For Each oSBody In oSBodies
    For Each oFace In oSBody.Faces
		Dim oFaceColl As FaceCollection
		oFaceColl = ThisApplication.TransientObjects.CreateFaceCollection
		oFaceColl.Add(oFace)
		oThicken = oCompDef.Features.ThickenFeatures.Add(oFaceColl, "0", PartFeatureExtentDirectionEnum.kNegativeExtentDirection, PartFeatureOperationEnum.kSurfaceOperation, False, False, False)
    Next 
Next 

 I hope it helps you solve your problem


Please accept as solution and give likes if applicable.

I am attaching my Upwork profile for specific queries.

Sergio Daniel Suarez
Mechanical Designer

| Upwork Profile | LinkedIn

Message 3 of 3

Anonymous
Not applicable

Thanks!

0 Likes