Is there anyway to transfer iLogic in one drawing to multiple drawings in Vault

Is there anyway to transfer iLogic in one drawing to multiple drawings in Vault

Venkatraj_GMHKXS6
Contributor Contributor
272 Views
4 Replies
Message 1 of 5

Is there anyway to transfer iLogic in one drawing to multiple drawings in Vault

Venkatraj_GMHKXS6
Contributor
Contributor

I have an iLogic created in a drawing that automatically renames borders based on sheet size. Now I want to transfer and iLogic to multiple drawings (with inconsistent border names) in vault and run the iLogic automatically so that all drawings are consistent.

 

1. Is there anyway to do it automatically. I keep reading about Batch processing and  event triggers. But I couldn't get the whole idea how to do it.

2. Is there anyway to do the same for AutoCAD drawings

0 Likes
Accepted solutions (1)
273 Views
4 Replies
Replies (4)
Message 2 of 5

WCrihfield
Mentor
Mentor
Accepted solution

Hi @Venkatraj_GMHKXS6.  Generally speaking, if you want the same exact iLogic rule to effect a lot of different drawings, then it may be much more beneficial to make that iLogic rule an 'external' one, instead of an 'internal' one.  An internal one is saved within an Inventor Document, while an external one is generally just a text file, with one of 3 possible file extensions.  One of the advantages of using an external rule is...if you ever need to change the code a bit, you can do so in just one place to fix everything, instead of having to find every document you ever copied that 'internal' rule into, and try to change that rule in all those different places.  Transitioning a rule from an internal one to an external one may, or may not require a few changes within the code, to ensure that the rule is targeting the correct document when it runs.

 

I am not familiar with Vault yet, but I do know how to copy internal iLogic rules from one document to one or more others.  There are many Inventor programming forum discussions involving that process, showing multiple different ways of doing that.  But I doubt that any of those examples include dealing with Vault in the process.  When Vault is involved, that usually means that each 'other' document would need to be 'checked-out' first, then opened (possibly invisibly), then edited by code (copying the rule into it), then saved, then 'checked-in' again.  The steps for checking out and checking back in later, are more complex, and often only possible when using the Professional version of Vault (or equivalent).

 

The iLogic 'Event Triggers' resource simply makes it easy for us to get our iLogic rules to run automatically when one or more of a certain few listed events happen.  There are multiple tabs within the Event Triggers dialog.  One is for 'all documents', one is for all assemblies, one for all parts, one for all drawings, and one us just for that one document ('This Document').  The settings on the 'This Document' tab are stored within that document, in a hidden property set.  The settings on all the other tabs are stored in an external XML document.  So, in this case, it sounds like you want something to happen within pretty much all drawings, from now on.  If that is the case, then you could put that rule under an event (like 'After Open Document', or 'Before Save Document') to make it run that rule whenever that event happens in all drawings that you interact with, when that event happens.  As mentioned before, that could be a single external rule, since those 'Event Trigger' settings on the 'Drawings' tab are also externally stored.  And I believe that when you have one of the higher installations of Vault (such as Professional), there may even be an event or multiple events in there involving Vault, but I am not sure, since I am still using Inventor 2024.3.4 Pro, and do not have Vault yet myself.

PS:  I have no idea about how to do something like this with AutoCAD drawings, or if it is even possible.  I have mainly focused on automating Inventor over the past decade, so it has been too many years since I did much with customization and automation within AutoCAD by code.  There are separate forums for that sort of thing though, which you could inquire within, and possibly get a lot more feedback in that area, if interested.

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

0 Likes
Message 3 of 5

Venkatraj_GMHKXS6
Contributor
Contributor

Hello @WCrihfield 

Thanks for the reply. I got some idea what needs to be done. Still a few questions left.

  1. These event triggers which is showing in Inventor (screenshot attached). Are these the only triggers that can be defined. Can we add more? Example. Trigger a iLogic when checkin happens or when i click 'update properties' in Inventor
  2. What is 'any parameter change' event trigger
0 Likes
Message 4 of 5

WCrihfield
Mentor
Mentor

Hi @Venkatraj_GMHKXS6.  That short list of events showing in your attached image are not the only ones there are.  But as for the "that can be defined" portion of your question, and the "can we add more" question...that will be a bit more difficult to explain.  That iLogic 'Event Triggers' dialog is just one way for us to be able to 'use' some specific events, but it is not the only way, and when using the other ways, there are a lot more events available.  Using the iLogic 'Event Triggers' dialog is certainly the simplest way for us to use events, because the iLogic add-in manages some stuff for us behind the scenes, but it also offers less control. and less potential for feedback than other ways.  As with most things in life, getting more control and functionality (from a coding/automation point of view) usually means more complication will be involved.  Even the events listed there have another way for us to use them without needing to use that dialog.  No, we can not directly add any more events into that 'Event Triggers' dialog, and we can not remove any of the events already listed in it either.  Each different type of document has a few 'common' types of events, but each different document type also has some events that are 'unique' to just that document type.  We do not even see all available events for each document type within the left 4 tabs.  To see all events available to each document type, you must visibly open each type of document on your screen, then open that Event Triggers dialog, and go to the 'This Document' tab to see the list of events that are available for that 'active' document.  That list of events is different for different types of documents.

The other way to access and use events is a rather long subject to discuss here, but most folks use Inventor Add-Ins for 'monitoring/listening' for the events defined within Inventor's API while Inventor is running, because it is easier to manage events that way, then with iLogic rules.  Add-Ins can be set to start when Inventor starts, and quit when Inventor quits, so that they are always 'active', but can be deactivated while Inventor is running, if needed.  The most common source (but far from the only source) of events in Inventor is the ApplicationEvents object, which has about 27 events defined within it, last I checked.  There are several other main objects within Inventor's API like that though, with other sets of events associated with them.  Each listed event has a 'definition line' for the Sub routine that can be used as its 'Event Handler', but it is not always explained super clearly how each definition parameter can, or has to be used.

Since I am not familiar enough with Vault yet myself, I am not 100% sure if there is an 'event trigger' or event for the Vault check-in step, but I would assume that if it is not already available, it may be very soon (possibly in a newer version of Inventor).  Since Vault is an entirely different Application than Inventor, cross-application related events are probably more challenging to monitor like that.  The event named "Any User Parameter Change" will cause any rule put under that event to get triggered to run every single time the value of any user parameter gets changed.  That can be a lot of times, especially if you have multiple rules already reacting to user parameter value changes, and changing other parameter values.  So, it is obviously handy, but is also not very efficient, when there may be alternative ways to do what needs to be done.  The similarly named event with 'Model' parameters in its name, is exactly the same description, but limited to just 'model parameters'.  The model parameters are the ones actually in direct control of your model geometry, and they will automatically be deleted when some things happen such as deleting a sketch dimension, or deleting a feature that uses it.  User parameters will continue to exist after such events, making them more stable for automation purposes.

I attached a PDF that I created a couple years ago, that was based on a pre-existing 'Autodesk knowledge base article' that I used to have posted online a few years ago, before Autodesk removed everyone's personal 'contribution posts' from the Autodesk Community area.  It really needs to be updated, but it will give you an idea about what I am talking about, if you are not already familiar with that process.

 

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

0 Likes
Message 5 of 5

Venkatraj_GMHKXS6
Contributor
Contributor

Thanks for the elaborate answer. It did really help me to understand things little better.

0 Likes