Inventor Customization

Reply
Active Contributor
Posts: 37
Registered: ‎04-17-2009
Message 1 of 3 (127 Views)

Pass Variable problems

127 Views, 2 Replies
06-17-2009 08:45 AM
I think this is a simple question but I cant seem to work it out. I have a main Sub that calls a Function, and I want to pass the value of a variable from my main Sub to my Function.

Here's what i'm doing, the whole code is rather long so here is a condensed version:
{code}
sub start()
'-open excel workbook-
dim oExclN as Integer
'-gather lots of information-
'-close workbook-
'-open inventor file-
call NewDocUpdater
end sub

private function NewDocUpdater()
'-call another function-
'-do stuff-
end function
{code}

I am trying to use "ByVal 'myvariable' as Integer". If I attach that to my Function, I get a "argument is not optional" error on the 'call NewDocUpdater' in my Sub. If i attach it to my Sub it wont run anymore. I've tried changing it to public and private on both Sub and Function but no change. And i'd like to pass this value along when my Function calls another routine.
Distinguished Contributor
Posts: 565
Registered: ‎02-12-2009
Message 2 of 3 (127 Views)

Re: Pass Variable problems

06-17-2009 08:54 AM in reply to: jknoll
sub start()
'-open excel workbook-
dim oExclN as Integer
'-gather lots of information-
'-close workbook-
'-open inventor file-
call NewDocUpdater(Argument)
end sub

private function NewDocUpdater(Argument as ?)
'-call another function-
'-do stuff-
end function
Active Contributor
Posts: 37
Registered: ‎04-17-2009
Message 3 of 3 (127 Views)

Re: Pass Variable problems

06-17-2009 09:02 AM in reply to: jknoll
Thanks CadFish, that was my problem. I was missing that little tab on my 'Call' line.

You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

Announcements
Are you interested in helping shape the Autodesk Community?
We’re looking at a few different ways to improve the “All Forums” landing page and need your feedback! If interested, please take a few minutes to fill out the following Usability Study. Thank you for your time!

Need installation help?

Start with some of our most frequented solutions to get help installing your software.

Ask the Community


Inventor Exchange Apps

Created by the community for the community, Autodesk Exchange Apps for Autodesk Inventor helps you achieve greater speed, accuracy, and automation from concept to manufacturing.

Connect with Inventor

Twitter

Facebook

Blogs

Pinterest

Youtube