Including multiple components in a pattern

Including multiple components in a pattern

SharkDesign
Mentor Mentor
847 Views
2 Replies
Message 1 of 3

Including multiple components in a pattern

SharkDesign
Mentor
Mentor

I'm using the function 

Patterns.AddRectangular

the help file describes parentcomponents as plural.  Does that mean I can include multiple parts here, or is it referring to plural only if you're patterning a pattern?

 

If I can add multiple parts in this single line of code, how do I do it?

 

Thanks

 

Dim rectPattern = Patterns.AddRectangular("RectPatternName", "ComponentA:1", 3, 1.5 in, Nothing, "X Axis", columnNaturalDirection := True, rowCount := 2, rowOffset := 1.0 in, rowEntityName := "Y Axis", rowNaturalDirection := True)
  Inventor Certified Professional
0 Likes
Accepted solutions (1)
848 Views
2 Replies
Replies (2)
Message 2 of 3

dutt.thakar
Collaborator
Collaborator
Accepted solution

@SharkDesign 

 

Yes, you can include, see below an example code, where I am adding multiple components in a pattern. You need to use  "{" brackets.

 

Patterns.AddCircular("Pattern Name",{"ANSI-Washer-01", "ANSI-Washer-02", "ANSI-Bolt-01", "ANSI-Nut"}, 6 ul , 360 deg / 6 ul,{"ABC", "abc"},"Y Axis")

 

Also to get the syntax right, I would suggest you create a pattern manually and then go to iLogic, right-click the pattern and click on Capture current state(Patterns. Add) to get this always correct. see below snap.

 

PatternAdd iLogic.png

 

Hope this will help you.

If this answer has solved your problem please ACCEPT SOLUTION and hit like if you found it helpful..!


Regards,
Dutt Thakar
LinkedIn
Message 3 of 3

SharkDesign
Mentor
Mentor

Ahhhhhh, it was the {} that I was missing, thanks a lot!

I did try the patterns.add but nothing happened. It works on the add.constraints ones, but the pattern ones never work for some reason. 

  Inventor Certified Professional
0 Likes