Community
Inventor Forum
Welcome to Autodesk’s Inventor Forums. Share your knowledge, ask questions, and explore popular Inventor topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Change Feature Direction with iLogic

6 REPLIES 6
SOLVED
Reply
Message 1 of 7
josephcooley
2303 Views, 6 Replies

Change Feature Direction with iLogic

How do you change a features direction (extrusion) with ilogic?

 

2011 win 7 x64

6 REPLIES 6
Message 2 of 7
Anonymous
in reply to: josephcooley

 

if you search the Autodesk Inventor Customization forum for ExtentDirection I think you'll find some examples.

 

I think you'll use kPositiveExtentDirection or kNegativeExtentDirection or kSymmetricExtentDirection

 

ExtentDirection 
Input constant that indicates which side of the sketch plane to extrude toward. kPositiveExtentDirection defines the offset direction to be in the same direction as the normal of the sketch plane.

 

edit: my search didn't turn up much, but here's an example from the COM API Reference

found at: C:\Program Files\Autodesk\Inventor 2011\Help\admapi_15_0.chm (I think on WinXP at least)

 

 

    ' Create a base extrusion 1cm thick.
    Dim oExtrude As ExtrudeFeature
    Set oExtrude = oCompDef.Features.ExtrudeFeatures.AddByDistanceExtent( _
                        oProfile, 0.25, kNegativeExtentDirection, kJoinOperation)

 

 

Message 3 of 7
MjDeck
in reply to: josephcooley

Here's a rule to do it.  It will work on an extrusion with Distance extents. 

In this sample, Extrusion1_direction is a numeric parameter.  The function only cares about the sign (positive or negative) of this parameter.

Sub Main
 ChangeExtrusionDirection("Extrusion1", Extrusion1_direction)
End Sub

Sub ChangeExtrusionDirection(featureName As String, direction As Double)
  app = ThisApplication
  Dim extrude As ExtrudeFeature = TryCast(Feature.InventorFeature(featureName), ExtrudeFeature)
  If (extrude Is Nothing) Then Return
  If (extrude.ExtentType <> PartFeatureExtentEnum.kDistanceExtent) Then Return
  Dim extent As DistanceExtent = TryCast(extrude.Extent, DistanceExtent)
  If (extent.Direction = PartFeatureExtentDirectionEnum.kPositiveExtentDirection And direction < 0) Then
     extent.Direction = PartFeatureExtentDirectionEnum.kNegativeExtentDirection
  ElseIf (extent.Direction = PartFeatureExtentDirectionEnum.kNegativeExtentDirection And direction > 0) Then
     extent.Direction = PartFeatureExtentDirectionEnum.kPositiveExtentDirection
  End If
End Sub

 


Mike Deck
Software Developer
Autodesk, Inc.

Message 4 of 7
josephcooley
in reply to: MjDeck

Hi @MjDeck I've got follow up question.  This is for a sheet metal face if that matters.

 

How can I make my ilogic code do the following psudocode

Value will be a multivalue text pull down in the ilogic form

 

If Value=A

Then Extrude one way

IF Value = B

Then Extrude other way

EndIf

Message 5 of 7
MjDeck
in reply to: josephcooley

@josephcooley , unfortunately the API function to flip the direction on a face feature doesn't work at this time. We have a work item named INVGEN-9652 for this.


Mike Deck
Software Developer
Autodesk, Inc.

Message 6 of 7
JBerns
in reply to: josephcooley

@MjDeck,

 

What is the status of this "flip direction" request for sheet metal features?

 

I am working on sheet metal flanges, contour flanges, and cuts, and have discovered several limitations related to feature editing.

 

For example, see this post:

https://forums.autodesk.com/t5/inventor-ilogic-and-vb-net-forum/control-sheet-metal-cut-direction/m-... 

 

I look forward to your reply.

 

 

Regards,

Jerry

-----------------------------------------------------------------------------------------
CAD Administrator
Using Inventor 2022
Autodesk Certified Instructor
Autodesk Inventor 2020 Certified Professional
Autodesk AutoCAD 2017 Certified Professional
Message 7 of 7
MjDeck
in reply to: JBerns

Hi Jerry - it looks like it has not been implemented yet. I'm trying to find out what the plans are.


Mike Deck
Software Developer
Autodesk, Inc.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Technology Administrators


Autodesk Design & Make Report