Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Strange iLogic error

3 REPLIES 3
SOLVED
Reply
Message 1 of 4
mrattray
1606 Views, 3 Replies

Strange iLogic error

I keep getting a rule compile error "all other subs and functions must appear after sub main" (see attached) for one of the rules in an assembly file. The thing is, Sub Main is the only sub or function in the rule and the only thing outside of it is my option explicit line. I checked, double checked, and then triple checked that I didn't have some stray sub statement somewhere and that Sub Main didn't have a typo.  I even tried deleting the option explicit line and making Sub Main the very first line in the rule.  I would just blow away the sub / end sub since it's the only one in the rule but I need to pass variables to it and I'm using the Sub Main(ByVal variable As Single) statement.

The wierd part is that it worked just fine yesterday, and I can't think of anything I've changed since then.

 

Any thoughts?

Mike (not Matt) Rattray

3 REPLIES 3
Message 2 of 4
mrattray
in reply to: mrattray

Maybe it'll help if I post the code. It's attached.

Mike (not Matt) Rattray

Message 3 of 4
mrattray
in reply to: mrattray

I managed to get a work around by commenting out the sub/end sub lines and passing the variables using an argument map and accessing the variables directly using the rulearguments function.  I'm still curious why Inventor doesn't like me using the ByVal argument, though.

Mike (not Matt) Rattray

Message 4 of 4
MjDeck
in reply to: mrattray

As you found, you have to use the RuleArguments function.  There's no way to pass arguments directly to Sub Main().  We could improve the error message.


Mike Deck
Software Developer
Autodesk, Inc.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report