How do I run a rule in one assembly to load and modify a second assembly?

How do I run a rule in one assembly to load and modify a second assembly?

ron.c
Advocate Advocate
368 Views
2 Replies
Message 1 of 3

How do I run a rule in one assembly to load and modify a second assembly?

ron.c
Advocate
Advocate

I want to run a rule in one assembly to load and modify (do a Component Replace) a second assembly.

 

I'm actually using the first assembly as a template to create 30 clones, incrementing the name of the new assemblies 1 through 30, which makes it easy to use them in for or while loops.

 

My problem is that even after opening the newly cloned assembly for editing Component.Replace ("Old_Component:1", "New_Component.ipt". True)  replaces the component in the original assembly, rather than the new assembly.

 

I have tried using MakePath, but that does not seem to help.

 

Any ideas?

 

Thanks!

0 Likes
369 Views
2 Replies
Replies (2)
Message 2 of 3

MechMachineMan
Advisor
Advisor
Sounds like you might be better off using the direct API call rather than the iLogic. If you look up ReferencedFileDescriptor.ReplaceReference() it will provide you with a more explicit way of replacing references.

--------------------------------------
Did you find this reply helpful ? If so please use the 'Accept as Solution' or 'Like' button below.

Justin K
Inventor 2018.2.3, Build 227 | Excel 2013+ VBA
ERP/CAD Communication | Custom Scripting
Machine Design | Process Optimization


iLogic/Inventor API: Autodesk Online Help | API Shortcut In Google Chrome | iLogic API Documentation
Vb.Net/VBA Programming: MSDN | Stackoverflow | Excel Object Model
Inventor API/VBA/Vb.Net Learning Resources: Forum Thread

Sample Solutions:Debugging in iLogic ( and Batch PDF Export Sample ) | API HasSaveCopyAs Issues |
BOM Export & Column Reorder | Reorient Skewed Part | Add Internal Profile Dogbones |
Run iLogic From VBA | Batch File Renaming| Continuous Pick/Rename Objects

Local Help: %PUBLIC%\Documents\Autodesk\Inventor 2018\Local Help

Ideas: Dockable/Customizable Property Browser | Section Line API/Thread Feature in Assembly/PartsList API Static Cells | Fourth BOM Type
0 Likes
Message 3 of 3

ron.c
Advocate
Advocate

I'm not having any problem replacing the component using:

 

Component.Replace(OldComponentName, NewComponentName, True)

 

My problem is running that rule from one assembly and making component replace in a second assembly.   You see, the same rule first makes a copy of the first assembly, then changes a component reference in the newly created copy.

 

 I have not been able to find any good documentation for ReferencedFileDescriptor.ReplaceReference()

 

- Ron

0 Likes