Control Extrude direction through iLogic

Control Extrude direction through iLogic

Anonymous
Not applicable
489 Views
2 Replies
Message 1 of 3

Control Extrude direction through iLogic

Anonymous
Not applicable
 

Hi,

I'm trying the extrude direction as 'kNegativeExtentDirection' and 'kSymmetricExtentDirection but it's not working properly.

Does anyone have any hints?

Below is my code:

Sub main()

Dim oDoc As PartDocument
 oDoc = ThisApplication.ActiveDocument

Dim oDef As PartComponentDefinition
 oDef = oDoc.ComponentDefinition

Dim oFace As Face


oFace = ThisApplication.CommandManager.Pick(SelectionFilterEnum.kPartFaceFilter, "Select the face.")

Dim ThickenDirection As New ArrayList
ThickenDirection.Add("Thicken Inward")
ThickenDirection.Add("Thicken Outward")
ThickenDirection.Add("Thicken both direction")



Dim oFaceColl As FaceCollection
 oFaceColl = ThisApplication.TransientObjects.CreateFaceCollection

oFaceColl.Add(oFace)
Dim oThicken As ThickenFeature

'Dim oExtrude As ExtrudeFeature


Direction = InputListBox("Thicken Direction", ThickenDirection, Direction, Title := "Thicken Direction", ListName := "Thicken Direction")
If Direction = "Thicken Inward" Then
	oThicken = oDef.Features.ThickenFeatures.Add(oFaceColl, "0.10 in", 
kPositiveExtentDirection, kJoinOperation)
'oExtrude = oDef.Features.ExtrudeFeatures.AddByDistanceExtent( _
'oFaceColl, "0.10 in", kPositiveExtentDirection, kJoinOperation)

Else If Direction = "Thicken Outward" Then
	oThicken = oDef.Features.ThickenFeatures.Add(oFaceColl, "0.10 in", 
kNegativeExtentDirection , kJoinOperation)
'oExtrude = oDef.Features.ExtrudeFeatures.AddByDistanceExtent( _
'oFaceColl, "0.10 in",kNegativeExtentDirection , kJoinOperation)

Else If Direction = "Thicken both direction" Then
	oThicken = oDef.Features.ThickenFeatures.Add(oFaceColl, "0.100 in", 
PartFeatureExtentDirectionEnum.kSymmetricExtentDirection, kJoinOperation)
'oExtrude = oDef.Features.ExtrudeFeatures.AddByDistanceExtent( _
'oFaceColl, "0.10 in",kSymmetricExtentDirection , kJoinOperation)
End If


End Sub
0 Likes
490 Views
2 Replies
Replies (2)
Message 2 of 3

Sergio.D.Suárez
Mentor
Mentor

Hi, the code related to "Thicken" works correctly.
The asterisk parts of the extrusion (those that are as comments) do not work because you want to load a collection of faces as a profile. You cannot make an extrusion by selecting a face, you need a profile, a closed region of a sketch.
I hope this helps with your problem. Regards


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

0 Likes
Message 3 of 3

Anonymous
Not applicable

yes,This is correct!

 

But my question is that 'kNegativeExtentDirection' and 'kSymmetricExtentDirection' not working properly. please ignore the commented code.!!!!

0 Likes