ilogic to flip the Rectangular Pattern as PartFeature

ilogic to flip the Rectangular Pattern as PartFeature

mallorn
Advocate Advocate
679 Views
3 Replies
Message 1 of 4

ilogic to flip the Rectangular Pattern as PartFeature

mallorn
Advocate
Advocate

hello,

How to flip the Rectangular Pattern set as a PartFeature?

 

Dim oDoc As PartDocument = ThisDoc.Document
Dim oCompDef As PartComponentDefinition = oDoc.ComponentDefinition
Dim oOccPat As PartFeature  = oCompDef.Features.Item("Rectangular Pattern1")
-------------------------
Tomasz Malinowski
0 Likes
680 Views
3 Replies
Replies (3)
Message 2 of 4

JelteDeJong
Mentor
Mentor

try this:

Dim oDoc As PartDocument = ThisDoc.Document
Dim oCompDef As PartComponentDefinition = oDoc.ComponentDefinition
Dim oRectangularPatternFeature As RectangularPatternFeature = oCompDef.Features.RectangularPatternFeatures.Item("Rectangular Pattern1")

'you can get the first item in the pattern like this
Dim oOccPat = oRectangularPatternFeature.Definition.ParentFeatures.Item(1)

Jelte de Jong
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature


Blog: hjalte.nl - github.com

0 Likes
Message 3 of 4

Curtis_Waguespack
Consultant
Consultant

Hi @mallorn ,

 

If you're asking about flipping the direction of the pattern, you can find and example here:

https://forums.autodesk.com/t5/inventor-customization/changing-circular-pattern-orientation-with-ilo...

 

Also just as a reminder, you can search and ask programming questions of this type on the Inventor Customization forum :
http://forums.autodesk.com/t5/Autodesk-Inventor-Customization/bd-p/120

 

I hope this helps.
Best of luck to you in all of your Inventor pursuits,
Curtis
http://inventortrenches.blogspot.com

 

EESignature

0 Likes
Message 4 of 4

WCrihfield
Mentor
Mentor

@mallorn Here's also a simple iLogic example of this

Dim oDoc As PartDocument = ThisApplication.ActiveDocument
Dim oDef As PartComponentDefinition = oDoc.ComponentDefinition
Dim oRectPattFeat As RectangularPatternFeature = oDef.Features.RectangularPatternFeatures.Item("Rectangular Pattern1")
If oRectPattFeat.Definition.NaturalXDirection = True Then
	oRectPattFeat.Definition.NaturalXDirection = False
ElseIf oRectPattFeat.Definition.NaturalXDirection = False Then
	oRectPattFeat.Definition.NaturalXDirection = True
End If
If oRectPattFeat.Definition.NaturalYDirection = True Then
	oRectPattFeat.Definition.NaturalYDirection = False
ElseIf oRectPattFeat.Definition.NaturalYDirection = False Then
	oRectPattFeat.Definition.NaturalYDirection = True
End If

I hope this helps.
If this solves your problem, or answers your questions, please click 'Accept As Solution".
Or, if this helps you reach your goal, please click 'LIKES" 👍.

Here are a few of the ideas I like.
If you agree, please vote for them, so they might get implemented.

  • Options to format contents of MessageBox, InputBox, and InputListBox Click Here
  • Ability to fully constrain and dimension to the edjes of images within drawing title block sketches, SketchedSymbol sketches, other drawing sketches, and assembly sketches Click Here
  • Save section view status in DesignViewRepresentation, so it can be used in drawing view Click Here
  • Add SolidBodies folder to iLogic Rule Editor Model Tab Click Here
  • Convert all views to Raster before autosave stores to 'OldVersions' folder Click Here

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

0 Likes