Anda di halaman 1dari 4

What is the iLogic Browser?

The iLogic Browser lists iLogic rules, forms, global forms and external rules.
A context menu is available for items in the iLogic Browser. The commands included in the menu
vary depending on the item selected.

If the browser is displayed when Autodesk Inventor is shut down, it is shown again (empty)
when Autodesk Inventor is restarted.

If a document is activated that does not support rules or forms (such as a presentation), or
if Autodesk Inventor is in the no document state, then the browser window is empty except
for the "iLogic" title. This convention is like the model browser in the no-document state.

If a document is activated that supports rules and forms, the tabs are shown whether or
not rules or form definitions exist in the active document.

In the iLogic Browser, rules are arranged under two tabs:

The Rules tab lists all rules stored in the document.


The External Rules tab lists all rules stored outside of Inventor (on disk), regardless of the
open document.

Forms are arranged under two tabs:

The Forms tab lists all forms and buttons to trigger rules stored in the current document.
The Global Forms tab lists all forms and buttons to trigger rules stored outside of Inventor,
regardless of the open document.

Once the iLogic Browser is shown, it remains displayed until closed manually. This setting is
retained across sessions.
The visibility of the iLogic Browser can be toggled on and off by activating or deactivating the
iLogic Browser check box. This check box can be found in the User Interface drop-down list
located on the Windows panel of the View tab.
Additionally, you can dock the iLogic Browser on either side of the Autodesk Inventor window.
What are rules?
A rule is a small Visual Basic (VB.NET) program that can monitor and control other Inventor
parameters, features, or components.
How do rules work?
iLogic embeds rules as objects directly into part, assembly, and drawing documents. The rules
determine and drive the design parameter and attribute values. By controlling these values, you
can define the behavior of model attributes, features, and components. Knowledge is saved and
stored directly in the documents, like the way in which geometric design elements are stored.
Parameters in rules
You can use standard Inventor parameter names in rules as Visual Basic variables. When you run
the rule, the value of the parameter is assigned to the variable. For a numeric parameter, the
value is a real number expressed in the document units specified in Tools
Document Settings.

Text parameters become String variables in the rule. True/false parameters become Boolean
variables.
Parameters can appear in two different ways:

VB.NET variables that are linked to numeric or non-numeric parameters. The variables are
highlighted in blue:

When a rule starts running, iLogic reads the values for these parameters from the model into
the rule. When the rule has finished running, iLogic saves the changed values back to the
model.
To save the values before the rule has finished running, use the RuleParametersOutput
function. This function is useful if you want to change the model immediately.

Parameters accessed using the Parameter function. For example:

When you assign values using this method, the values are saved to the model immediately,
before the next line in the rule runs. When you read a value using the Parameter function, it is
immediately read from the Inventor model.
Change default entity names in rules
Before you use one of the following Autodesk Inventor entity names in a rule, change its name if it
was assigned a default name when it was created:

feature

sketch

work feature

pattern

constraint

iMate

Use a meaningful name. The name change makes it easier for yourself and others using the model
to see what the rule is doing.
Another reason to change default names is to make them more portable. In localized versions of
Autodesk Inventor, default item names are translated to the language of that version. The names
are automatically changed in the model browser, but not in an iLogic rule. Therefore, the rule may
be unable to find items using the default name. If someone else uses the model in a different
language version of Inventor, the default names must be changed. This recommendation applies
only to items that are called out by name in the rule. For example, the Measure functions can use
work feature names. If you have work features, but you do not use them in Measure functions,
then you do not have to rename them.One exception to this recommendation is embedded Excel
spreadsheets. Do not rename them.
On non-English versions of Autodesk Inventor, use an English name in the rule. For example:
"3rd Party:Embedding 1"
NoteSome entities such as iMates allow you to specify a name when you create them.

When does a rule run?


Rules usually run automatically in response to changes in parameter values, if the parameters are
used directly as variables in the rule. You can also trigger rules by events.
A rule runs immediately after you edit it, unless it is suppressed. When rules run, changes in the
parameters do not update the model until after the rule runs. If necessary, you can force
parameter changes to take effect immediately using either:

the Parameter function

the RuleParametersOutput() function in the rule

Rule order

Rules are run in the order in which they appear in the browser, unless specified otherwise
by inclusion of the iLogicVb.RunRule("ruleName") function.

If more than one rule references a parameter that changes, the rule that appears first in
the list runs first. It happens regardless of how the parameter is changed.

You can use the Event Triggers command to change the rule order in the list associated
with document events, independent of the main iLogic Browser list.

How is a rule processed?


When you create or edit a rule, the rule text is converted into valid VB.NET code and then
compiled. Some Inventor parameter names are not valid as VB.NET variable names. To allow for
the full range of Inventor parameter names, iLogic internally substitutes new variable names for
the Inventor parameters.
Units in rules
You can use Inventor units in rules in the same manner as they are used in standard Inventor
parameter equations.

Rules do not require units. For example, suppose a number is assigned to a parameter that
is not unitless, but no units are specified in the expression. In this case, iLogic assumes that
the number uses the document units that conform to the parameter. This type of assumption
also applies to compound units, such as mi/hr. Document units are set in Tools
Document
Settings
Units in Inventor.

Unit names can only be used directly after numbers in the rule text. They cannot be used
after parameters, variables, or expressions.

External rules

External rules can be used as iLogic rules, or as small programs that are run manually (like
VBA macros). They are stored in text or VB files, outside of any Inventor document (part,
assembly, or drawing). You can run them manually or from other rules.
When you view the list of external rules in the iLogic Browser, the list is the same for
whatever document you have open. It is not tied to each individual document.
You can also run external rules as event-driven rules.

Wizards

iLogic provides several wizards you can use to create sophisticated rules for certain tasks. These
wizards are available on the Wizards tab of the Edit Rule dialog box:

Create Rule for a Dialog - Use a custom dialog box to drive parameter values.

Capture Current View - Capture view orientation and zoom display values.

Message Box - Create a rule that displays a Windows message box.

Parameter Limits - Set minimum and maximum values for parameters.

What are forms?

Create and connect a custom user interface to the parameters, properties, and rules of an
Inventor part, assembly or drawing document. Use drag and drop methods to design a user
interface with no need for programming. Use the controls to drive changes to an existing
design. Form definitions can be document specific and saved with a design document or
stored for use across multiple documents.
NoteIt is not necessary to have rules to create forms.

Anda mungkin juga menyukai