- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Not sure my title is proper, but it's the best I can come up under the circumstances.
I've been moving to addins and vb.net and have been doing OK. I've been using the paper 'Taking the step from VBA to Inventor Add-ins' as a bit of a guideline.
Based on that, in your StandardAddInServer.vb file, there will be a line:
m_inventorApplication = addInSiteObject.Application
From there, i add my buttons/panels/ribbons/etc....culminating in the OnExecute event.
Private Sub myButton1_OnExecute(byVal Context as Inventor.NameValueMap)
myFunction1(m_inventorApplication)
end Sub
Then in myModule.vb i have the code
Private Sub myFunction1(ThisApplication as Inventor.Application)
To my understand this sends the Inventor Application to the function. And this part works just fine.
My problem seems to be that myFunction1 calls myFunction2 which also needs ThisApplication.
Private Sub myFunction1(ThisApplication as Inventor.Application)
{Bunch of stuff happens here}
myFunction2("Text")
end sub
Private Sub myFunction2(dType as string)
uses ThisApplication
{Stuff happens here differently depending on the string sent}
end sub
How do i go about sending the Inventor application to function2, along with the string? I've tried a few things, but can't get it to work. Apparently m_inventorApplication HAS to be in the OnExecute on the myFunction1 line - myFunction1(m_inventorApplication) - Any attempt are removing that fails.
Any help/explanation would be appreciated as i have a couple other functions to translate at somepoint that go 3-4 levels deep.
Solved! Go to Solution.