Share

Best Practices: iLogic

iLogic calls to User Interface (UI) Elements

  • Do not make calls to the MessageBox, InputBox or InputlistBox functions within your iLogic rules. Do not call any User Interface (UI) elements using Inventor APIs such as file dialog boxes or anything that would cause an Inventor UI element to pop on the display. 
    • DA4i (Inventor Design Automation on Autodesk Platform Services) has no User Interface and does not support UI related API functions or methods. 
  • For models to be used in Inventor on the desktop as well as for publishing with Informed Design, you can create your rules such that any calls to UI elements get turned off before publishing using a Boolean parameter in Inventor. 

alt



Rules in Drawings

  • When Inventor drawings are included with the Base Model being Published, make sure any rules contained in those drawing that are responsible to updating the drawing when the model is reconfigured are set to fire on Document Open (the drawing document) 
  • This ensures that the drawings are updated for each variant Informed Design generates outputs for them in the Web App as native .idw files, dwg files or PDF files. 
  • Set rules in your drawings to fire on the “After Open Document” event using the “Event Triggers” command found in the iLogic commands group in the Inventor Manage Ribbon.  

alt



Input Rules vs Model Rules

In Inventor, keep Input Rules separate from Model rules. Input Rules only involve Input Parameters (i.e. User Parameters in the Base Model for driving configurations) 

Examples of Input Rules 

  • Min/Max/Increment Enforcement  Rules that set the upper and lower bounds allowed for a parameter value and/or rounds off any value supplied using some increment. 

    alt

  • Multi-Value List Control  Rules that change the list of values (options) for a Mult-Value list parameter based on some condition or other Input value.

    alt

  • Input Parameter Formulas and Equations Rules that involve formulas and equations that drive some Input parameter values using the values entered or calculated for other Input parameters. 

    alt

Model Rules involve manipulating the Inventor model somehow. Examples of Model Rules

  • Suppress Features, Components or Constraints

    alt

  • Add/Remove Components or Constraints

    alt

  • Set Parameter or iProperty Values

    alt

  • Update or Save the Document

    alt

Input Rules will need to be re-mastered in the Informed Design Product Definition using Codeblocks 

  • Input rules can exist in both iLogic and Informed Design in order for the model to be usable (reconfigurable) on the desktop as well as in Revit, but care should be taken to ensure they are not in conflict

    • With your Input rules separated from your Model rules, you have the option to suppress Input rules on the desktop before publishing with Informed Design to ensure only one set of rules is at play, thus avoiding potential conflicts. 

    • You also have the option to define your Inventor side Input rules to run conditionally based on evaluation of a dedicated Inventor True/False (boolean) type parameter. 

      alt

  • Any Input rules in the inventor Model will be the last to fire when using the model in Informed Design from the Revit side, so if there is a conflict, iLogic rules will have the last say in the result. 



iLogic with Excel

  • iLogic interaction with Excel on Inventor Design Automation (Inventor running in the Cloud) is limited to reading from and writing to an Excel file. The Excel application is not running on the Server in the Cloud that is running Inventor, so Excel cannot be used to perform any calculations that you may want to read the results of from iLogic like you can with Inventor Running on the Desktop.  
  • Use the iLogic Configuration setting in Inventor (accessed in zero doc mode) to set the Excel Options to "Internal" as the default Microsoft Excel Engine to be used by iLogic. This is an application-level option.

alt

  • Set Excel Options to "Internal"

    • The default Microsoft Excel Engine is Internal. Internal is a library that provides fast access to Excel data and limits you to read/write to the Excel file format without having to actually run the Excel application 

    • Excel COM is the Microsoft Office Excel API. It can be used only when Excel is installed on the computer which means it is not supported on APS as the computers running Inventor in the cloud do not have Excel installed 

    • You can Get More Info on this topic here.

      alt



Rules that Set Materials

Copy all Inventor Materials into the Base Model document if you will be using rules to change the Material assigned to components in Inventor based on the Input options. 

  • This will ensure that your rules can successfully assign the different material options on DA4i (Design Automation for Inventor) where your specific materials may not exist in the default Material library. 

alt



Skeleton Modeling

To use this common modeling technique with Informed Design, create your skeleton model as per usual and then: 

  • Add a set of User Parameters as Input Parameters in the Base Model (root assembly) These are the Parameters you will adopt into the Product Definition. 
  • In the Base Model document, Create an iLogic rule that pushes the Input Parameter values from the Base Model to the Parameters in the skeleton model. Changes to parameter values in the skeleton model will then propagate to the components derived from the skeleton as usual. 
  • More information about the Skeleton Modeling Technique can be found [here].(https://help.autodesk.com/view/INVNTOR/2022/ENU/?guid=GUID-D96F0063-3813-4EED-98FA-C34D3946265C)


Model States for Alternate LOD (Level of Detail) 

Using Model States as configurations (where each model state has a separate set of Parameter & Property values) is not yet supported by Informed Design. Parameter and iProperty values must be identical across all Model States.

Use Model States to define alternate LOD (levels of detail) for use as a simplified Revit Family representation. 

Use valid file names for Model State names. Inventor allows for names with special characters that are not supported by Informed Design. 

Use suppression in Inventor to turn off components and features not needed for the level of detail required for Revit. 

Save your Inventor Model with the Primary Model State active and set before publishing it with Informed Design.

alt

Use/Include "iLogicVb.MemberEditScope = kEditAllMembers" at the top of each iLogic rule to ensure Parameter & iProperty value changes are applied to all Model states each time the model is reconfigured. 

  • iLogic MemberEditScope functions are new with Inventor 2024. To enable these functions and use them in iLogic rules you have to options 

    • Install the Informed Design Inventor Add-In before running iLogic rules that call these functions 

    • Create the required system environment variable on your computer named "iLogicAllowMemberEditScope" and set its value to 1 

      • Environment Variable > iLogicAllowMemberEditScope = 1 

        alt



Inventor Application API Calls 

  • Use "ThisDoc.Document" in place of "ThisApplication.ActiveDocument" in iLogic rules when making Inventor API calls 
  • ThisApplication is not supported. You could use ThisServer instead which is also supported on the desktop. This will only contain properties and functions that Inventor Server supports, so you won't find e.g. ActiveDocument property on it. 
  • For more info on this go [here].(https://aps.autodesk.com/blog/prepare-ilogic-rules-design-automation


iLogic Forms 

  • You can continue to include and use iLogic forms in the Inventor models you publish with Informed Design 
  • Make sure not to launch iLogic forms using rules. iLogic Forms are themselves UI elements that are not supported on Design Automation for Inventor (DA4i) 
  • To test generating configurations on the desktop in a way that closely matches how they will be generated by Informed Design, set your iLogic Form Behavior>Predefined Buttons property to "OK Cancel" or "OK Cancel Apply". 
    • You should also order and group your parameters on your iLogic form similar to how you group and order them in the Informed Design Product Definition 
    • A Future version of Informed Design will allow you to use the Informed Design Form in Inventor as well as within Revit so as to avoid the need for an iLogic form altogether to test or use the model on the desktop.

Was this information helpful?