Hi @SpokenEarth. The manual process may only be available in a newer version of Inventor than you currently have, not sure. But the screen capture images below show how I can do it while using Inventor Pro 2024.


Since your first image shows one of the iLogic ruled from the part being within the assembly, I can only assume that the copy & paste part worked, but it must have tried to run that iLogic rule when you pasted it there, then the rule threw an error, because the rule was expecting to find a part document, but it found an assembly document instead, and could not cast (convert) the one type of document to the other type of document. This is a common error when there is no document type check included at the start of an iLogic rule, and it gets ran while another document type is active. I can only speculate if that is what happened there though.
There is something you must be aware of about document associations and referenced documents. When you are working with an assembly, and have placed some components into it, then we can figure out from the assembly side about what documents the assembly is referencing. Each assembly component will be referencing some other model document that is stored in a file somewhere else in your file system. However, we can not figure out if this assembly we are currently working with may be referenced within any other assemblies (as a sub assembly in them), because nothing gets recorded within this assembly when it gets added as a component into another assembly. There will also not be anything in this assembly telling us if it has a drawing or if it is being referenced within any drawings. The same is true for parts. A part essentially does not know if it is being used within any assemblies, or in any drawings, because nothing gets recorded within that part when it gets used in an assembly or drawing. So, when we are working with a part by code, there is no way for us to know if this part is being referenced by an assembly component within any assemblies, or is being shown within any drawings. Therefore technically, the file on disk for a part is not part of any assembly or drawing. That part file can be referenced by either of them, but there is no way for us to know if it is being referenced by any of them. If you are using Vault (I am not), then you may be able to use Vault's functionality to figure out if a part is being used by any assemblies or drawings that are also within the Vault system, because that is one of its advantages. I would not know how to do that by code though.
So, with that in mind, if I write an iLogic code for copying internal iLogic rules, even if the part were the active document (currently showing on your screen) when you started the rule, we could use that to determine the 'source' document to get the rules from, but I still need a way to specify that you want them to be copied to the assembly. There is no direct step from the active part to the assembly, because there is no link on the part's side to that assembly.
Some options:
(term "source" means the document containing the rules to be copied)
(term "destination" means the document that the rule will be copied into)
- The code can contain the full path & file name of both files.
- The code can contain try to use the currently 'active' document as the 'source' file, then the code can contain the full path & file name of the destination file.
- The code can contain try to use the currently 'active' document as the 'destination' file, then the code can contain the full path & file name of the source file.
- The code can contain a routine that will show you a file dialog, which would allow you to browse for either the source file, the destination file, or both.
- If the code will always be started while an assembly is active (never while a part or drawing is active), then we could include code for allowing assembly component selection. Then some more code could extract what document that assembly component is referencing, and use that as either the source file or destination file, but it would have to be specified which is source, and which is destination.
I will attach a text file containing some code you can copy and paste into an iLogic rule, and try out for this task, but it is using the option of using a file dialog to have you choose both the source and destination files. I added a lot of comments in there, to help you follow along with what the intent of the code is, and what is going on. And I built a lot of potential feedback in there also, for just in case something goes wrong, or something is not right during this process. But as I said, there are lots of different ways a code like this could be designed and created, depending on a lot of different preferences.
Wesley Crihfield

(Not an Autodesk Employee)