Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.
Anonymous
819 Views, 4 Replies

Add iAssembly through iLogic Rule

I am trying to add an iAssembly through an iLogic Rule.

 

This the code I am using.

Components.AddiPart(xyz:1, xyz.iam, {"Member", "A"})

 

However, on running the rule, it says :

File "d:\foldername\xyz.iam" does not exist or is not an iPart factory.

(The name of the actual file and path has been changed for this post)

 

But I am 100% sure that this is an iAssembly.

Does iAssembly not work with "Components.AddiPart" function?

 

Thanks

Daan_M
in reply to: Anonymous

The snippet is placed under the 'iLogic Assemblies/Components' tab, but i don't believe it is meant for adding a complete iAssembly into a document when i read the description.

 

Daan_M_0-1600778824422.png

 

Maybe the code 'Component.Replace' helps

 

 

J-Camper
in reply to: Anonymous

This is how it has worked for me in the past, where oPos is a Matrix and SelectRow is an Integer:

Dim NewoOcc As ComponentOccurrence = ThisDoc.Document.ComponentDefinition.Occurrences.AddiAssemblyMember(FilePath, oPos, SelectRow)

I have had luck changing rows of an existing iAssembly with shorthand, where Row is an Integer:

iPart.ChangeRow(oOcc.Name, Row)

 

dutt.thakar
in reply to: Anonymous

@Anonymous 

 

Component.AddiPart does not work for iAssemblies.

 

What you can do is use these snippets instead

 

Components.Add("xyz:1","xyz.iam") - To add the iAssembly inside your assembly

iPart.FindRow("xyz:1","Member","=","A") - To change the row that you want to in that iAssembly.

 

Please accept this if this has answered your question.

 

Regards,

Dutt Thakar

 

 

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


Regards,
Dutt Thakar
LinkedIn
Anonymous
in reply to: dutt.thakar

Thanks @Daan_M  and @J-Camper for your replies.

@dutt.thakar your solution works.

Thanks again