I definitely know what you are talking about. Most of the time when Intellisense is not offering any suggestions about some of my code, I understand why, but not 100% of the time. But explaining all the possible reasons why it could happen (possibly with examples) would require typing up a novel here in a forum reply, and would most likely still be incomplete or contain some bad information. It's just to broad of a subject. One of the most common situations is when a property returns an 'Object' (or Variant in VBA) type value, instead of a more specific Type. When that happens, it stops helping, because a plain Object does not have any properties or methods (besides ToString method).
If you have ever inspected the 'temp' text file that gets automatically created for your 'regular' iLogic rule (usually located at C:\Users\%user%\AppData\Local\Temp\iLogic Rules\), you will get a 'hint' about some of the 'extra' stuff that actually gets added into our rules 'behind the scenes' that we never see, but not all of it. When our 'internal' iLogic rules get stored in the Document, some (if not all) of that data gets stored within document level Attributes, one way or another, either as a String, or as a Byte Array. And there are usually two different versions of each internal rule...the 'Exec' version, and the version that looks like what you see in the 'temp' file, with the extra hints in it. The Exec version includes the whole rule, with all the additional stuff, such as the other half of the 'Public Partial Class' block of code. (See examples below)
The main Class that automatically encloses all of our 'normal' iLogic rules is called 'ThisRule', and that Class block of code is created for us automatically behind the scenes, as a 'Public Partial Class', and it will even add the 'Class ThisRule...End Class' part into our rule, if we do not include it ourselves (but we never see that). So, there is a whole other section to this Class in which they create variables, and assign values to them, and create pointers to entire large blocks of other codes that we never see. The iLogic add-in will also create/add the 'Sub Main...End Sub' for us behind the scenes, if we do not include them ourselves, but we usually never see that either. These things are required in normal 'VB.NET' coding environments, but iLogic makes it easier for those who are not used to that, and do not know about all those vb.net coding expectations/requirements, to write code that will work for us, to automate Inventor.
The following online help page touches on some of this stuff, but does not really go deep into the details of it.
Advanced iLogic Techniques Reference
Example of normal, internal rule, with only 3 lines of code:
Dim oInvApp As Inventor.Application = ThisApplication
Dim oDoc As Document = ThisDoc.Document
MessageBox.Show("DisplayName = " & oDoc.DisplayName, "DisplayName", MessageBoxButtons.OK, MessageBoxIcon.Information)
And here is an example of the 'Temp' file contents for that rule above:
Imports System.Windows.Forms ''**iLogic system**
''**iLogic system code start**
Imports Inventor
''**iLogic system code end**
Public Partial Class ThisRule ''**iLogic system**
Public Sub Main() Implements IRuleInterface.Main ''**iLogic system**
Dim oInvApp As Inventor.Application = ThisApplication
Dim oDoc As Document = ThisDoc.Document
MessageBox.Show("DisplayName = " & oDoc.DisplayName, "DisplayName", MessageBoxButtons.OK, MessageBoxIcon.Information)
End Sub ''**iLogic system**
End Class ''**iLogic system**
And below is the 'Exec' version of that same rule:
'''' concatenated string lengths: 538 1155
Imports System.Windows.Forms ''**iLogic system**
''**iLogic system code start**
Imports Inventor
''**iLogic system code end**
Public Partial Class ThisRule ''**iLogic system**
Public Sub Main() Implements IRuleInterface.Main ''**iLogic system**
Dim oInvApp As Inventor.Application = ThisApplication
Dim oDoc As Document = ThisDoc.Document
MessageBox.Show("DisplayName = " & oDoc.DisplayName, "DisplayName", MessageBoxButtons.OK, MessageBoxIcon.Information)
End Sub ''**iLogic system**
End Class ''**iLogic system**
Public Partial Class ThisRule
Implements IRuleInterface
Public m_iLogicVersionDate as Integer = 20170212
Private m_iLogicHost As IRulesHost
Private m_pc39483c As IParamChanger
Private iLogicVb As ILowLevelSupport
Private InventorVb As ILowLevelSupport
Private ThisApplication As Inventor.Application
Private ThisDoc As ICadDoc
Private Const KeysOnly As XmlSaveOption = XmlSaveOption.KeysOnly
<System.Diagnostics.DebuggerNonUserCode()> _
Public Sub SetHost(ByVal host As IRulesHost) Implements IRuleInterface.SetHost
m_iLogicHost = host
m_pc39483c = host.GetParamChanger()
Me.iLogicVb = host.GetLowLevelSupport()
Me.InventorVb = Me.iLogicVb
ThisApplication = InventorVb.Application
ThisDoc = New CadDoc(iLogicVb.RuleDocument, InventorVb.InventorServer)
End Sub
<System.Diagnostics.DebuggerNonUserCode()> _
Public Sub RuleParametersInit() Implements IRuleInterface.RuleParametersInit
End Sub
<System.Diagnostics.DebuggerNonUserCode()> _
Public Sub RuleParametersOutput() Implements IRuleInterface.RuleParametersOutput
m_pc39483c.OutputToCadModel()
End Sub
End Class
I believe this Exec version of the rule may get 'generated' based on the iLogic system's inspection of our regular rule's contents, then it is what actually gets ran/used. I believe this because it actually tells us that if we use certain terms (such as ThisApplication, ThisDoc, MessageBox.Show, and others) within our rules, it will automatically include specific 'Imports' statements (such as for 'Inventor' and 'System.Windows.Forms') in the 'Header' of our rule for us (as you can see in 'Exec' the code above).
So as you can see, there is a whole lot of other stuff going on in the background to enable our 'simpler' experience within our iLogic rules. And this is just the tip of the iceberg so to speak. Ended up typing a whole lot after all. 🙄
Wesley Crihfield

(Not an Autodesk Employee)