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

Add iAssembly through iLogic Rule

Anonymous

Add iAssembly through iLogic Rule

Anonymous
Not applicable

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

0 Likes
Reply
Accepted solutions (1)
817 Views
4 Replies
Replies (4)

Daan_M
Collaborator
Collaborator

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

 

 

0 Likes

J-Camper
Advisor
Advisor

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
Collaborator
Collaborator
Accepted solution

@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
0 Likes

Anonymous
Not applicable

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

@dutt.thakar your solution works.

Thanks again

0 Likes