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

It sounds like you have created a separate Class block of code, and are trying to use the common iLogic objects within that Class.  This is a common problem, but a very difficult one to explain properly.  The iLogic add-in and its user interface (the iLogic Rule editor dialog) do a whole lot of extra stuff for us, to make automating Inventor simpler and easier for beginners, who do not have much (if any) previous coding experience.  One of the things it does for us is create a bunch of 'Rule Objects' for us (behind the scenes, where we do not see the code supporting it) to readily use in our simpler rules (rules without Class/Module/Structure type blocks of code).  Part of how this is done is with a 'Partial' Class, where we never really see that 'other' partial Class named "ThisRule".  The iLogic add-in will automatically create that Class for us, so we do not need to start all of our rules with a Class statement.  It will also automatically create the 'Sub Main' block for us, if we do not.  But, we never see all that stuff.

 

The most common way to use those types of objects that are unique to the iLogic add-in within other Classes, is to 'pass' them in, either through input variables to methods (subs or functions) defined within the Class (such as the 'New' sub routine), or through public properties defined within the Class.

You can also review the following topic:

https://forums.autodesk.com/t5/inventor-programming-ilogic/object-reference-issue-in-rule/m-p/130311... 

Wesley Crihfield

EESignature

(Not an Autodesk Employee)