Edit an existing Extrusion with Ilogic / vba

Edit an existing Extrusion with Ilogic / vba

Anonymous
Not applicable
1,880 Views
7 Replies
Message 1 of 8

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
Accepted solutions (1)
1,881 Views
7 Replies
Replies (7)
Message 2 of 8

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

Jamie Johnson : Owner / Sisu Lissom, LLC https://sisulissom.com/
Message 3 of 8

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.

Message 4 of 8

Anonymous
Not applicable

Hello,

 

thank you for your help 🙂

 

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 🙂

 

Sincerely

0 Likes
Message 5 of 8

lzs013
Advocate
Advocate
Accepted solution

oEF = Feature.InventorFeature(“Bohrungen”)

oEF.Definition.SetThroughAllExtent(kNegativeExtentDirection)

oEF.Operation = kCutOperation

Message 6 of 8

Anonymous
Not applicable

Thanks so much!

Now it works and i know why. Smiley Very Happy

 

Sincerely

0 Likes
Message 7 of 8

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
Message 8 of 8

lzs013
Advocate
Advocate

vDividerBase=Feature.InventorFeature("vDivider Base") 

vDividerBase.Definition.SetDistanceExtentTwo = 0.9

vDividerBase.Definition.SetDistanceExtent = 0.05