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

Glad I could help. :slightly_smiling_face:

   Just in cast you weren't aware though, the codes provided by @el_jefe_de_steak  were VBA code.  You wouldn't be able to run these directly within an iLogic rule, like the code I posted.  To use the VBA code, you would open your VBA Editor [Tools tab > Options panel > VBA Editor] then create a new Module under either your ApplicationProject or under a DocumentProject, then paste that code into that module.  (If under the DocumentProject, it will only be available to that document.)  Once you have done this the code in that module becomes what is known as a VBA Macro.  The Macro will be named according to the name of the Module and the name of the first Public Sub or Function within that module.  Then when you are outside of the VBA Editor, you can click the Macros button [Tools tab > Options panel > Macros], which will open a small dialog box.  Then in the drop-down list beside "Macros in:", select the Project you placed the Module under.  Then all available Modules within that Project will show in the "Macro name:" window above that.  Select the one you want, then click Run.

   Or, if you're already familiar with all that, then you may also know that you can create a button within you ribbon to represent a macro, and that clicking this button will run the macro.  This is what he was referring to at the beginning of the second post.

   You can also run iLogic rules from VBA macros, by telling the macro to run the iLogic rule (not by pasting iLogic code into the module).  There are several posts here on this forum that can show you how to do this if that's what you were hoping for.

Wesley Crihfield

EESignature

(Not an Autodesk Employee)