明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
楼主: goldenshin

Autocad2005编程指南(1)用VB.net编写Arx程序

  [复制链接]
发表于 2004-4-8 00:17 | 显示全部楼层
看来我要开始学3次开发了


真的看不懂哦!!
发表于 2004-4-10 17:31 | 显示全部楼层
ahlzl发表于2004-4-3 21:20:00AX是什么啊?

我想是ActiveX吧。先引用部件,再设置属性,方法。VB6.0可以做CAD的二次开发。我在大学期间做过一些程序(不敢说是软件)。我认为它唯一的毛病在于速度慢。
发表于 2004-4-16 22:40 | 显示全部楼层
  1. Imports Autodesk.AutoCAD.ApplicationServices
  2. Imports Autodesk.AutoCAD.DatabaseServices
  3. Imports Autodesk.AutoCAD.Runtime
  4. Imports Autodesk.AutoCAD.Interop
  5. Imports Autodesk.AutoCAD.Geometry
  6. Imports DBTransMan = Autodesk.AutoCAD.DatabaseServices.TransactionManager
  7. Public Class TLCad
  8.        <CommandMethod("test")> Public Shared Sub MytestCmd()
  9.                Dim db As Database = Application.DocumentManager.MdiActiveDocument.Database
  10.                Dim tm As DBTransMan = db.TransactionManager
  11.                Dim myT As Transaction = tm.StartTransaction()
  12.                Try
  13.                        Dim line As New Line(New Point3d(0, 0, 0), New Point3d(1, 1, 0))
  14.                        Dim bt As BlockTable = CType(tm.GetObject(db.BlockTableId, OpenMode.ForRead, False), BlockTable)
  15.                        Dim btr As BlockTableRecord = CType(tm.GetObject(bt(BlockTableRecord.ModelSpace), OpenMode.ForWrite, False), BlockTableRecord)
  16.                        btr.AppendEntity(line)
  17.                        tm.AddNewlyCreatedDBObject(line, True)
  18.                        Dim tbl As RegAppTable = CType(myT.GetObject(db.RegAppTableId, OpenMode.ForWrite, False), RegAppTable)
  19.                        Dim app As New RegAppTableRecord
  20.                        app.Name = "test1"
  21.                        tbl.Add(app)
  22.                        tm.AddNewlyCreatedDBObject(app, True)
  23.                        line.XData = New ResultBuffer( _
  24.                                        New TypedValue(CInt(DxfCode.ExtendedDataRegAppName), "test1"), _
  25.                                        New TypedValue(CInt(DxfCode.ExtendedDataAsciiString), "tlcad test"))
  26.                        myT.Commit()
  27.                Finally
  28.                        myT.Dispose()
  29.                End Try
  30.        End Sub
  31. End Class
看了上面的例子,有OBJECTARX的感觉!createLine()
{
       AcGePoint3d startPt(4.0, 2.0, 0.0);
       AcGePoint3d endPt(10.0, 7.0, 0.0);
       AcDbLine *pLine = new AcDbLine(startPt, endPt);       AcDbBlockTable *pBlockTable;
       acdbHostApplicationServices()->workingDatabase()
               ->getSymbolTable(pBlockTable, AcDb::kForRead);       AcDbBlockTableRecord *pBlockTableRecord;
       pBlockTable->getAt(ACDB_MODEL_SPACE, pBlockTableRecord,
               AcDb::kForWrite);
       pBlockTable->close();       AcDbObjectId lineId;
       pBlockTableRecord->appendAcDbEntity(lineId, pLine);       pBlockTableRecord->close();
       pLine->close();       return lineId;
}
发表于 2004-4-22 15:05 | 显示全部楼层
用VB。Net 开发出来的程序是用dll作扩展名的?


是否只支持CAD2005,不支持2002吗?
发表于 2004-4-22 15:10 | 显示全部楼层
是的
发表于 2004-5-19 09:07 | 显示全部楼层
请问有相关的参考书卖没有


能不能给一个创建实体的例子,如 创建点线 注写文字等


在此谢谢啦
发表于 2004-5-19 09:17 | 显示全部楼层
已看到啦谢谢啦
发表于 2004-5-19 09:20 | 显示全部楼层
告诉大家一个好消息, cad2005中文正式版出来啦在 http://down.9iv.com/ 有得下,不过有点慢, 只能单线程下 我已下下来啦,很好用,绝对正式注册版
发表于 2004-6-3 10:38 | 显示全部楼层
我想请问怎样才能找到Objectarx,万分感谢
发表于 2004-6-3 19:56 | 显示全部楼层
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2024-3-28 16:28 , Processed in 0.209736 second(s), 17 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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