Adding VB External Rule Dependencies to VB External Rules

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I am currently trying to produce a number of modules as iLogic External Rules with Straight VB Code enabled. My hope is that each module will host a series of functions that can be called from a iLogic rule without instantiating a object of a class. Each of these modules may use functions from a separate module as part of a functions code. Right now I can get the iLogic code able to reach one deep, but it runs into a issue trying to access a function from that module to another module. The test code looks like this:
Main iLogic Code:
AddVbFile "FunctionTools\foo.vb"
Sub Main()
Dim oDoc = ThisDoc.Document
foofunc(oDoc)
End Sub
The First Level External VB Module:
Imports System
Imports System.Math
Imports System.Collections
Imports System.Windows.Forms
Imports Microsoft.VisualBasic
Imports Autodesk.iLogic.Interfaces
Imports Autodesk.iLogic.Runtime
Imports Inventor
AddVbRule "FunctionTools\bar.vb"
Module foo
Public Function foofunc(oDoc As Document)
MsgBox("FOO" & oDoc.FullFileName)
barfunc(oDoc)
End Function
End Module
The Second Level External VB Module:
Imports System Imports System.Math Imports System.Collections Imports System.Windows.Forms Imports Microsoft.VisualBasic Imports Autodesk.iLogic.Interfaces Imports Autodesk.iLogic.Runtime Imports Inventor Module bar Public Function barfunc(oDoc As Document) MsgBox(oDoc.FullFileName) End Function End Module
I am hitting "Error on Line 12 : Declaration expected." on the AddVbRule line which either implies that the syntax is incorrect for how you call other rules in Straight VB, or this kind of chained call is not allowed. I have tried using Imports and AddVbFile to no success.