Click to See Complete Forum and Search --> : Linking AUtocad 3D Model with VB6
jordan222
Jul 25th, 2001, 08:41 PM
I've created 3D model of a robotic arm using Autocad 2000. I would like to control the movements of the robot arm using VB6. Can anyone tell me what should I do to achieve this?
Or is there any sites regarding 3D robot arm simulation that uses Autocad and VB6?
I really need help in this. Pls tell me!
Roberto Mendoza
Jul 27th, 2001, 05:30 AM
Hello,
You can control AutoCAD 2000 from VB using Autocad's Object model. You have to create an object and init it. This is my code to start to use AutoCAD controled by VB. If ypu want more help you can use the Autocad's help and find "Application". I don't know anything about your robot arm, but I hope this will help you. Bye.
Code:
Public Sub Inicializar()
Dim N As Integer
Dim cont As Long
Dim NombFAC As Integer
On Error Resume Next
cont = 1000000
repetir:
Set AppACAD = Nothing
Set AppACAD = GetObject(, "AutoCAD.Application")
If AppACAD Is Nothing Or Err Then
Err.Clear
Set AppACAD = CreateObject("AutoCAD.Application")
If Err Then
Beep
cont = cont - 1
If cont <= 0 Then
N = MsgBox("AutoCAD no responde,¿Desea Reintentar la conexión?", vbCritical + vbYesNo, NombFAC)
If N = vbYes Then
Err.Clear
GoTo repetir
End If
Exit Sub
Else
GoTo repetir
End If
End If
End If
Set AppACAD = Nothing
Set AppACAD = GetObject(, "AutoCAD.Application")
AppACAD.Visible = True
On Error GoTo 0
End Sub
jordan222
Jul 27th, 2001, 10:27 AM
Hello Roberto,
Thanks for your help. I hope this will help me in my project.
If I need anymore help, I hope I can ask you. Thanks again.
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.