Dim rectPattern = Patterns.AddRectangular

Dim rectPattern = Patterns.AddRectangular

tomislav.peran
Advocate Advocate
330 Views
2 Replies
Message 1 of 3

Dim rectPattern = Patterns.AddRectangular

tomislav.peran
Advocate
Advocate

Hi, 

I am struggling to find the solution for the following.

I have a List of Strings representing Occurence Names that I added into an assembly, like Pen:1, Pen:2 etc.

 

addedPens As List(Of String)

That I converted to List of ManagedCompOcurrences, just to try if pattern will work. 

Dim componentRefs As New List(Of ManagedComponentOccurrence)
	For Each name In addedPens
		'use Pens names to get the correct object
		componentRefs.Add(Components.Item(name))
	Next

However, when I use both Lists as an argument in:

Dim rectPattern = Patterns.AddRectangular("test", componentRefs , 3, 3000, _

I constantly get errors. 

I tried converting both Lists to an Array but that failed as well. 

 

I even tried declaring Argument as:

Dim compOrPattern As New ComponentOrPattern(componentRefs), because it says in the documentation:

 

ComponentOrPattern(IEnumerable(Object))
Construct from a list of objects. If one of the items is not convertible to a ComponentOrPattern, an exception will be thrown.

 

Does anyone have experience with this? Any help is welcome.

 

Tom 

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

JMGunner
Advocate
Advocate
Accepted solution

This was only soultion i find 

too add more componets 

 

 

 

Best  JM

 

Patterns.AddRectangular

 

 

Value = Qty Value = Size

 

Patterns.Delete("SupportPattern")

 

''Qty of Componetents

 

Dim compPatterns(2) As ComponentOrPattern

 

compPatterns(1) = "Support"

compPatterns(0) = "Support2"

compPatterns(2) = "Support5"

 

Patterns.AddRectangular("SupportPattern",compPatterns, Qty, Size, "", "X Axis")

 

Message 3 of 3

tomislav.peran
Advocate
Advocate

Hey man, this approach with Array of ComponentOrPattern works.  I can use this.

 

Have a nice day a thank you very much for helping out!

 

Tom