Message 1 of 5
VB Public variable of inventor app is not read from other subs.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
So I start w/ this, I'm using VB.net through Visual studio
Imports System
Imports System.Type
Imports System.Activator
Imports System.Runtime.InteropServices
Imports Inventor
'Imports AutoCAD
Imports System.Windows.Forms
Module GlobalVariables
Public _invApp As Inventor.Application
End Module
Then I added
Private Sub Get_Volumes_Click_1(sender As Object, e As EventArgs) Handles Get_Volumes.Click
Dim ptCurrent As _invapp.ActiveDocument
Dim mpropProp As Inventor.MassProperties
mpropProp = ptCurrent.componentdefinition.massproperties
End Sub
_invApp is used on other subs in the class but for some reason I can't get the new button's code to recognize _invApp.
Anyone know what I did wrong?