明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 1909|回复: 4

求助vb简单问题

[复制链接]
发表于 2005-10-21 09:00:00 | 显示全部楼层 |阅读模式
我想在vb中直接控制AutoCAD画图,请问我该如何把vb与cad连接上呢???
发表于 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.Version
End 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 AcadDocument
Set acadDoc = acadApp.ActiveDocument

From this point on, use the acadDoc variable to reference the current AutoCAD drawing.

   

 楼主| 发表于 2005-10-23 20:35:00 | 显示全部楼层
thank  you
发表于 2005-11-3 12:31:00 | 显示全部楼层

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

发表于 2005-11-3 16:51:00 | 显示全部楼层

已经很详细了

您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|CAD论坛|CAD教程|CAD下载|联系我们|关于明经|明经通道 ( 粤ICP备05003914号 )  
©2000-2023 明经通道 版权所有 本站代码,在未取得本站及作者授权的情况下,不得用于商业用途

GMT+8, 2024-11-27 08:26 , Processed in 0.175841 second(s), 24 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表