Advanced API functions in iLogic

ThisApplication

The Inventor application object for the current session of Autodesk Inventor. From this object, you can directly access the Inventor API. For Help on the API, refer to the Programming Help, which is under Additional Resources on the Help Menu.

This object is also accessible using the older syntax:

app = InventorVb.Application

ThisDoc.Document

Gets the document in which the current rule is stored, as an Inventor.Document object. It can provide a starting point from which to examine or modify the model. This object is described in the Inventor API help.

Syntax

doc = ThisDoc.Document

This object is also accessible with the older syntax:

doc = iLogicVb.RuleDocument

ModelDocument

Gets the model document (part or assembly) that is shown in a drawing document. If no model document exists, this function returns Nothing. If more than one model document exists, it returns the first one found.

Syntax

doc = ThisDoc.ModelDocument

Automation

Accesses the iLogicAutomation object in a rule.

Syntax

auto = iLogicVb.Automation

UserInterfaceManager

Required in a rule before using certain Inventor API functions such as Document.SelectSet.Select. If you encounter a VBA sample or other API code that does not work within a rule, add this statement at the top of the rule.

Syntax

ThisApplication.UserInterfaceManager.UserInteractionDisabled = False

InventorComponent

Use this function to get direct access to a component. It returns an object of the type Inventor.ComponentOccurrence.

Syntax

compo = Component.InventorComponent(“componentName”)

InventorFeature

Gets direct access to a feature. This function returns an object of the type Inventor.PartFeature.

Syntax

feat = Feature.InventorFeature(“featureName”)

InventorFeature (component)

Gets direct access to a feature in a component or document.

Syntax

feat = Feature.InventorFeature(componentOrDocNameName, “featureName”)