toosimple 发表于 2005-10-21 09:00:00

求助vb简单问题

我想在vb中直接控制画图,请问我该如何把vb与cad连接上呢???

alin 发表于 2005-10-21 09:17:00

Use the Help files....
In 2004
The following code example uses the Clear and Description properties of Err. If your coding environment does not support these properties, you will need to modify the example appropriately:
Sub Ch2_ConnectToAcad()    Dim acadApp As AcadApplication    On Error Resume Next      Set acadApp = GetObject(, "AutoCAD.Application.16")    If Err Then      Err.Clear      Set acadApp = CreateObject("AutoCAD.Application.16")      If Err Then            MsgBox Err.Description            Exit Sub      End If    End If    MsgBox "Now running " + acadApp.Name + _         " version " + acadApp.VersionEnd Sub
Next, set the document variable to the Document object in the AutoCAD application. The Document object is returned by the ActiveDocument property of the Application object.
Dim acadDoc as AcadDocumentSet acadDoc = acadApp.ActiveDocument
From this point on, use the acadDoc variable to reference the current AutoCAD drawing.


toosimple 发表于 2005-10-23 20:35:00

thankyou

wangjd 发表于 2005-11-3 12:31:00

我需要VB打开AutoCAD的详细程序

mjtppf 发表于 2005-11-3 16:51:00

已经很详细了
页: [1]
查看完整版本: 求助vb简单问题