乐筑天下

搜索
欢迎各位开发者和用户入驻本平台 尊重版权,从我做起,拒绝盗版,拒绝倒卖 签到、发布资源、邀请好友注册,可以获得银币 请注意保管好自己的密码,避免账户资金被盗
查看: 135|回复: 0

[编程交流] Open AutoCAD Using C#

[复制链接]

180

主题

639

帖子

463

银币

中流砥柱

Rank: 25

铜币
897
发表于 2022-7-6 22:08:57 | 显示全部楼层 |阅读模式
For the last few years I've been using this code in VB.NET to open a drawing in AutoCAD. This works great and it looks for an existing instance to use before opening a new one:
  1.        Dim vAcadApp As AcadApplication       Dim vAcadDoc As AcadDocumentTry           If Process.GetProcessesByName("acad").Length > 0 Then               vAcadApp = GetObject(, "AutoCAD.Application.19")           Else               vAcadApp = New AcadApplication           End If           vAcadApp.Visible = True           vAcadApp.WindowState = AcWindowState.acMax           vAcadDoc = vAcadApp.Documents.Open(DwgPath & DwgName, True)
We've now begun working more with C# so I'm searching for how to do this very same thing but in C#.
 
And there is one other caveat on this I must deal with. This will be run at the users' desktop and we have various versions of AutoCAD running. Some 2009's sprinkled here and there but mostly 2013 and 2014. I'm fearing that this will make loading the appropriate reference a complicated task.
回复

使用道具 举报

发表回复

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

本版积分规则

  • 微信公众平台

  • 扫描访问手机版

  • 点击图片下载手机App

QQ|关于我们|小黑屋|乐筑天下 繁体中文

GMT+8, 2025-3-4 11:53 , Processed in 1.044867 second(s), 54 queries .

© 2020-2025 乐筑天下

联系客服 关注微信 帮助中心 下载APP 返回顶部 返回列表