- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
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
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
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.
Maybe the code 'Component.Replace' helps
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
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)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
@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
Regards,
Dutt Thakar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report