Sculpt - cannot get surfaces right

Sculpt - cannot get surfaces right

NachoShaw
Advisor Advisor
311 Views
2 Replies
Message 1 of 3

Sculpt - cannot get surfaces right

NachoShaw
Advisor
Advisor

Hey

 

im trying to make a sculpt feature but i keep getting an error on the CreateSculptSurface function.

 

I am creating a surface of a curved lump by using the thicken command as a surface with a 0 thickness. This gives me

 

ThickenSrf in the browser

srf1 in the surface folder

 

I am creating an ObjectCollection to place the surface in and have tried many options like

adding srf1 to the collection

looping the faces and adding them individually

but when i get to the point of creating the SculptSurface, i get an error

 

Are there any examples of this working properly within a part component environment? In total, there are 6 surfaces to my thicken feature. None of them are planar or can have a plane attached to them.

 

Question:

can i convert a non planar face / surface to a work surface? If so, how? is that also a loop through faces?

 

the api help file is quite limited to examples.

 

one thing i do know is that when i do it manually, if i select the ThickenSrf, that is shown as the underlying surface and if i select srf, that is show too with ThickenSrf underlying that.

 

 

Thanks

Nacho
Automation & Design Engineer

Inventor automation Programmer (C#, VB.Net / iLogic)
Furniture, Sheet Metal, Structural, Metal fab, Tradeshow, Fabrication, CNC

EESignature


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.


0 Likes
312 Views
2 Replies
Replies (2)
Message 2 of 3

J-Camper
Advisor
Advisor

It's a bit hard to help without any reference to the code you are using, but with a watertight WorkSurface this bit of code has worked for me:

 

Dim pDef As PartComponentDefinition = TryCast(ThisApplication.ActiveDocument.ComponentDefinition, PartComponentDefinition)
If IsNothing(pDef) Then Logger.Trace("Not run in a Part Document") : Exit Sub
If pDef.WorkSurfaces.Count < 1 Then Logger.Trace("No work surface to sculpt") : Exit Sub

Dim SurfCol As ObjectCollection = ThisApplication.TransientObjects.CreateObjectCollection
Dim NewSculptSurf As SculptSurface
'Create Sculpt Surface From Work Surface 1
NewSculptSurf = pDef.Features.SculptFeatures.CreateSculptSurface(pDef.WorkSurfaces.Item(1), PartFeatureExtentDirectionEnum.kSymmetricExtentDirection)
SurfCol.Add(NewSculptSurf)
'Create Scult Feature
Dim newSculpt As SculptFeature
newSculpt = pDef.Features.SculptFeatures.Add(SurfCol, PartFeatureOperationEnum.kNewBodyOperation)

More detail or a sample part of the problem would help.

0 Likes
Message 3 of 3

NachoShaw
Advisor
Advisor

Hey

 

Thanks for that. I'll make a sample part and post it later with a greater detail of what im trying to achieve.

 

 

Thanks

 

Nacho
Automation & Design Engineer

Inventor automation Programmer (C#, VB.Net / iLogic)
Furniture, Sheet Metal, Structural, Metal fab, Tradeshow, Fabrication, CNC

EESignature


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.


0 Likes