Dont know how to place a copy of a component or assembly in an assembly with ilogic code

Dont know how to place a copy of a component or assembly in an assembly with ilogic code

richie_rQYQ8U
Contributor Contributor
192 Views
1 Reply
Message 1 of 2

Dont know how to place a copy of a component or assembly in an assembly with ilogic code

richie_rQYQ8U
Contributor
Contributor

Hi,

 

Can Anyone rewrite this code to add a copy of the component into the assembly Please.

 

'Place Steel channel
Dim Steel_Deck_Pos = ThisAssembly.Geometry.Matrix(0, 0, -1, 0,
                                                   0, 1, 0, 0,
                                                   1, 0, 0, 0,
                                                   0, 0, 0, 1)
Dim Steel_Deck = Components.Add("_Steel Deck", "Steel Deck.ipt",
                                  position := Steel_Deck_Pos,
                                  grounded := True)
0 Likes
Accepted solutions (1)
193 Views
1 Reply
Reply (1)
Message 2 of 2

A.Acheson
Mentor
Mentor
Accepted solution

Here is an example of using the built in component.add method and then just specify the occurrence to target. change the occurrence name to whatever you need.

Dim comp As ManagedComponentOccurrence = Components.Item("Part")
Dim partDoc As PartDocument = comp.Occurrence.Definition.Document
MessageBox.Show(partDoc.FullFileName, "Title")

Dim PartPos = ThisAssembly.Geometry.Point(-2429.92508, 8568.343945, -695.96213)
Dim Part = Components.Add("", partDoc.FullFileName, PartPos)

 

If this solved a problem, please click (accept) as solution.‌‌‌‌
Or if this helped you, please, click (like)‌‌
Regards
Alan
0 Likes