Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.

Edit an existing Extrusion with Ilogic / vba

Anonymous

Edit an existing Extrusion with Ilogic / vba

Anonymous
Not applicable

Hello,

 

i have an existing Extrusion. I won't to change this from increase to cut out.
The name of the Extrsion is "Bohrungen"

 

SourceSource

Won't change to:

Hole thrue allHole thrue all

 

 

 

 

I have found a code that change the direction but i don't know to change the extrusion to Cut thrue.

 

Here is the code that i have now:

 

SyntaxEditor Code Snippet

Sub Main

 Dim extrude As ExtrudeFeature = TryCast(Feature.InventorFeature("Bohrungen"), ExtrudeFeature)
 Dim extent As DistanceExtent = TryCast(extrude.Extent, DistanceExtent)
 
If Noppen = True Then
 
 extent.Direction = PartFeatureExtentDirectionEnum.kPositiveExtentDirection
 
Else

extent.Direction = PartFeatureExtentDirectionEnum.kNegativeExtentDirection

End If
 
  
 
 
 
End Sub

 

 

I have tested with the kCutOperation, but i don't know how?

 

Sincerely

0 Likes
Reply
Accepted solutions (1)
1,413 Views
7 Replies
Replies (7)

JamieVJohnson2
Collaborator
Collaborator

I created a deck feature using this method.  The 'Operation' property of the ExtrusionDefinition of the ExtrusionFeature is what you are after aka ExtrudeFeature.Defnition.Operation

            

        Dim edDeck As ExtrudeDefinition = cdCarDeck.Features.ExtrudeFeatures.CreateExtrudeDefinition(skDeckProfile.Profiles.AddForSolid, PartFeatureOperationEnum.kNewBodyOperation)
                    edDeck.SetDistanceExtent(RowCar.DeckWidth * 2.54, PartFeatureExtentDirectionEnum.kSymmetricExtentDirection)
                    Dim efDeck As Inventor.ExtrudeFeature = cdCarDeck.Features.ExtrudeFeatures.Add(edDeck)

 

                    extrusionDefinition.Operation=PartFeatureOperationEnum.kCutOperation 'and all other types

jvj

lzs013
Advocate
Advocate

ExtrudeDefinition Object

Operation

Read-write property that gets and sets the type of operation used to add the feature to the model. Valid inputs are kNewBodyOperation, kJoinOperation, kCutOperation, kIntersectOperation and kSurfaceOperation.

Anonymous
Not applicable

Hello,

 

thank you for your help :slightly_smiling_face:

 

I only have a little problem.

I have change the Operation to kCutOperation, thats work fine, but i won't that there is no distance - only thrue all.

Can you help me again? Witch parameter is responsible for the "thrue" option?

Thanks :slightly_smiling_face:

 

Sincerely

0 Likes

lzs013
Advocate
Advocate
Accepted solution

oEF = Feature.InventorFeature(“Bohrungen”)

oEF.Definition.SetThroughAllExtent(kNegativeExtentDirection)

oEF.Operation = kCutOperation

Anonymous
Not applicable

Thanks so much!

Now it works and i know why. Smiley Very Happy

 

Sincerely

0 Likes

Anonymous
Not applicable

HI there, I'm building a very simple illogic rule to turn features on and off based on a parameter. in one case I need to flip one of the extrude features. I'm unsure how to insert your code into my rule can you provide some guidance?

 

If Vertical_Divider = "Full" Then

Feature.IsActive("vDivider Base") = True

Feature.IsActive("vDivider Top") = True

ElseIf Vertical_Divider = "None” Then

Feature.IsActive("vDivider Base") = True

(here I need to flip the vDivider Base asymmetric extrusion from 9,0.5 to 0.5,9)

Feature.IsActive("vDivider Top") = False

ElseIf Vertical_Divider = "Upper" Then

Feature.IsActive("vDivider Base") = False

Feature.IsActive("vDivider Top") = True

End If

 

Thanks for your help

0 Likes

lzs013
Advocate
Advocate

vDividerBase=Feature.InventorFeature("vDivider Base") 

vDividerBase.Definition.SetDistanceExtentTwo = 0.9

vDividerBase.Definition.SetDistanceExtent = 0.05