Creating a shell feature and removing a face created in the step before

Creating a shell feature and removing a face created in the step before

Anonymous
Not applicable
716 Views
2 Replies
Message 1 of 3

Creating a shell feature and removing a face created in the step before

Anonymous
Not applicable

Hello,

 

Im trying to create a shell feature but it gives me back an error.

 

 

Dim oThickness As Double = 1

Dim Shellfeatures As ShellFeatures = pDef.Features.ShellFeatures

Dim oFaces As FaceCollection = invApp.TransientObjects.CreateFaceCollection
Dim oFace As Face

For Each oFace In pDef.SurfaceBodies.Item(1).Faces
oFaces.Add(oFace)
Next

Dim Shelldef As ShellDefinition = pDef.Features.ShellFeatures.CreateShellDefinition(oFaces, oThickness, ShellDirectionEnum.kOutsideShellDirection)

Dim NewShellFeat As ShellFeature = Shellfeatures.Add(Shelldef)

 

 

 

The part has been sculpted and then splitted. One of the two bodies resulting from the split has no visibilty, the other one is the one supposed to make the shell. How can I get this to work and then also how do I specifiy which face to delete so the part becomes hollow? The face that needs to be deleted is the one created during the split.

 

 

Cheers, Omar

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

Anonymous
Not applicable

here also a screenshot to make it more clear what I am trying to achieve.

 

 
 
 

Shell_feature.JPG

0 Likes
Message 3 of 3

J-Camper
Advisor
Advisor

@Anonymous,

 

I will post in both blog posts, but I added a subroutine for the shell procedure to the rule I posted last time.  I will also attached the file i was using to play with the non-watertight scenario to your Original Post .  I'm still having issues with using the patches I can make, so some more work needs to be done there, but the process for a watertight mesh import works as desired. 

 

I am attaching only attaching the full rule to your Original Post the rule as a .txt file so you don't have to read through an entire blog post.  Let me know if you need anymore help

 

Here is the shell subroutine:

Sub ShellThis(Body As SurfaceBody, Def As PartComponentDefinition)
	
	Dim OurNewFace As FaceCollection = ThisApplication.TransientObjects.CreateFaceCollection
	'Select the face we created with our split feature
	For Each f As Face In Body.Faces
		If f.CreatedByFeature.Type = ObjectTypeEnum.kSplitFeatureObject
			OurNewFace.Add(f)
		End If
	Next
	'Define Shell and create Shell Feature
	Dim ShellFeatDef As ShellDefinition = Def.Features.ShellFeatures.CreateShellDefinition(OurNewFace,"5 mm", ShellDirectionEnum.kOutsideShellDirection)
	Dim ShellFeat As ShellFeature = Def.Features.ShellFeatures.Add(ShellFeatDef)

End Sub

The FaceCollection wants to be only the faces to remove from the shell procedure.  I was wrong about the last indexed face being the one created by the split feature, so I'm getting the correct face by checking each face's CreatedBy Property before adding to the collection.