trying to open AutoCAD application from MathCAD

trying to open AutoCAD application from MathCAD

Anonymous
Not applicable
525 Views
1 Reply
Message 1 of 2

trying to open AutoCAD application from MathCAD

Anonymous
Not applicable
Hi,

I am trying to open the autoCAD application from MathCAD. I am writing the following code behind a MathCAD button. I am newbie at writing code in VBScript. The script is not executing correctly. Can someone please help? Appreciate.

Dim state

Sub PushBtnEvent_Start()
Rem TODO: Add your code here
End Sub

Sub PushBtnEvent_Exec(Inputs)
Dim acad

acad = CreateObject(, "Autocad.Application.16.0")
acad = GetObject(, "Autocad.Application.16.0")
acad.Visible = True

End Sub

Sub PushBtnEvent_Stop()
Rem TODO: Add your code here
End Sub

Sub PushBtn_Click()
If state = 0 Then
state = 1
Else
state = 0
End If
PushBtnEvent_Exec(acad)
End Sub



thanks
-vim
0 Likes
526 Views
1 Reply
Reply (1)
Message 2 of 2

Anonymous
Not applicable
If this isn't related to Civil3d, you might get more
reponses in the VBA newsgroup.

AFAIK, There is no "AutoCAD.Application.16.0".

Try "AutoCAD.Application.16"

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD 2008
Supporting AutoCAD 2000 through 2008
http://www.acadxtabs.com

wrote in message news:[email protected]...
Hi,

I am trying to open the autoCAD application from MathCAD. I am writing the following code behind a MathCAD button. I am newbie at writing code in VBScript. The script is not executing correctly. Can someone please help? Appreciate.

Dim state

Sub PushBtnEvent_Start()
Rem TODO: Add your code here
End Sub

Sub PushBtnEvent_Exec(Inputs)
Dim acad

acad = CreateObject(, "Autocad.Application.16.0")
acad = GetObject(, "Autocad.Application.16.0")
acad.Visible = True

End Sub

Sub PushBtnEvent_Stop()
Rem TODO: Add your code here
End Sub

Sub PushBtn_Click()
If state = 0 Then
state = 1
Else
state = 0
End If
PushBtnEvent_Exec(acad)
End Sub



thanks
-vim
0 Likes