Using Ilogic to add a new member to my Iassembly

Using Ilogic to add a new member to my Iassembly

systemerorr41
Participant Participant
426 Views
4 Replies
Message 1 of 5

Using Ilogic to add a new member to my Iassembly

systemerorr41
Participant
Participant

 Hi All 🙂

 

I have an Iassembly.

Data about width / depth / height of a box get automatically imported by an Ilogic rule.

I'd like the ilogic rule to automatically create a new member in the Iassembly every time new data gets imported.

 

How can I create a new member in an Iassembly using Ilogic?

 

0 Likes
Accepted solutions (1)
427 Views
4 Replies
Replies (4)
Message 2 of 5

dalton98
Collaborator
Collaborator

I haven't worked much with iAssemblies so I'm confused about what your asking. Would you like to place a new component with the desired l/w/h. or add a new row to the iAssembly table with l/w/h?

0 Likes
Message 3 of 5

systemerorr41
Participant
Participant

Hi,

Thanks for replying! 🙂

Sorry for the confusion, it's indeed 'adding a new row to the iAssembly table with l/w/h'

0 Likes
Message 4 of 5

dalton98
Collaborator
Collaborator
Accepted solution

I used this blog post

https://modthemachine.typepad.com/my_weblog/begging-api/page/2/

This example was used on an iPart but I assume it works the same way

Before:

daltonparrish_0-1649451439417.png

Code:

Dim oFactoryDoc As PartDocument
oFactoryDoc = ThisApplication.ActiveDocument

Dim oPartFactory As iPartFactory
oPartFactory = oFactoryDoc.ComponentDefinition.iPartFactory

oWS = oPartFactory.ExcelWorkSheet
oWS.Cells(3, 1) = "Vise_Screw-02"
oWS.Cells(3, 2) = "Vise_Screw-02"
oWS.Cells(3, 3) = "vise_screw_length - 58.737 mm"
oWS.Cells(3, 4) = "200 mm"

oWS.Parent.Save
oWS.Parent.Close

After:

daltonparrish_1-1649451485203.png

 

Message 5 of 5

dalton98
Collaborator
Collaborator

@systemerorr41 Also to get the number of rows in the iassembly you would do:

oRows = oPartFactory.TableRows.Count + 1

 

0 Likes