Patterning a Feature across the mid plane

Patterning a Feature across the mid plane

Anonymous
Not applicable
655 Views
2 Replies
Message 1 of 3

Patterning a Feature across the mid plane

Anonymous
Not applicable

Afternoon Everyone,

 

I finally figure out how to pattern a feature but now I can't get it pattern from the mid plane. It's probably something simple but I can't see it. Would really appreciate some help. Thanks

 

 

Dim objCol As ObjectCollection
Set objCol = ThisApplication.TransientObjects.CreateObjectCollection
Call objCol.Add(oPartDef.Features("Extrusion1"))


Set oRecPat = oPartDef.Features.RectangularPatternFeatures.Add(objCol, oPartDef.WorkAxes.Item("X Axis"), False, 98, 1, kDefault, , _
                        oPartDef.WorkAxes.Item("Y Axis"), True, 1, 1, kDefault, , kIdenticalCompute, kIdentical)

 

Set oRecPat.Definition.XDirectionMidPlanePattern = True

0 Likes
Accepted solutions (1)
656 Views
2 Replies
Replies (2)
Message 2 of 3

Owner2229
Advisor
Advisor
Accepted solution

Here you go, RED is what I've changed:

 

Dim oDoc As Document = ThisApplication.ActiveDocument
Dim oPartDef As ComponentDefinition = oDoc.ComponentDefinition
Dim oCol As ObjectCollection = ThisApplication.TransientObjects.CreateObjectCollection
oCol.Add(oPartDef.Features("Extrusion1"))

Dim AxeA As WorkAxis = oPartDef.WorkAxes("X Axis")
Dim AxeB As WorkAxis = oPartDef.WorkAxes("Y Axis")

Dim oRecPat As RectangularPatternFeature = oPartDef.Features.RectangularPatternFeatures.Add(_
oCol, AxeA, False, 98, 1, PatternSpacingTypeEnum.kDefault, , AxeB, True, 1, 1, _
PatternSpacingTypeEnum.kDefault, , PatternComputeTypeEnum.kIdenticalCompute, PatternOrientationEnum.kIdentical)

oRecPat.Definition.XDirectionMidPlanePattern = True
Consider using "Accept as Solution" / "Kudos" if you find this helpful.
- - - - - - - - - - - - - - -
Regards,
Mike

"Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live." - John F. Woods
Message 3 of 3

Anonymous
Not applicable

Awesome, Thanks!

 

The whole time I was trying to mess with XDirectionMidPlanePattern, no wonder I couldn't get it working.

0 Likes