Home test Inventor VB Connect to Inventor using Late Binding
23 | 02 | 2012
Main Menu
Search
Paypal Donation
So we can continue and expand this site
Content View Hits : 469531
Connect to Inventor using Late Binding PDF Print E-mail
User Rating: / 0
PoorBest 
Tutorials

The code below connect to Inventor using late binding. 

"Inventor

View source
 Public Sub connectInv22()
 
 
 
 
 
	Dim objBlockRef As Object
 
	Dim oApp As Object
 
 
 
	On Error GoTo errorhandler
 
 
 
	'attempt to get last version of Inventor opened
 
	oApp = GetObject(, "Inventor.Application")
 
	If Err.Number <> 0 Then
 
	MsgBox("InventorĀ application is not open")
 
	Err.Clear()
 
	Exit Sub
 
 
 
	'attempt to create instantiation of last version of Inventor opened
 
	oApp = CreateObject("Inventor.Application")
 
	'no AutoCAD is available
 
	If Err.Number <> 0 Then
 
	MsgBox("Cannot start Inventor... sorry!", vbExclamation, "Error starting Inventor")
 
	End If
 
	End If
 
	AppActivate("Inventor")
 
	oApp.Visible = True
 
	Dim oDoc As Object
 
	oDoc = oApp.ActiveDocument
 
 
 
	Msgbox oDoc.Name
 
 
 
	errorhandler:
 
 
 
	MsgBox(Err.Description)
 
	End Sub

 
Advertising

LOGON
Sponsored Links