How do you change a features direction (extrusion) with ilogic?
2011 win 7 x64
Solved! Go to Solution.
Solved by MjDeck. Go to Solution.
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)
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
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
@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.
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:
I look forward to your reply.
Regards,
Jerry
Hi Jerry - it looks like it has not been implemented yet. I'm trying to find out what the plans are.
Can't find what you're looking for? Ask the community or share your knowledge.