翱翔人生
发表于 2004-4-8 00:17:00
看来我要开始学3次开发了
真的看不懂哦!!
LostPatrol
发表于 2004-4-10 17:31:00
ahlzl发表于2004-4-3 21:20:00static/image/common/back.gifAX是什么啊?
<BR>我想是ActiveX吧。先引用部件,再设置属性,方法。VB6.0可以做CAD的二次开发。我在大学期间做过一些程序(不敢说是软件)。我认为它唯一的毛病在于速度慢。
lotusfly
发表于 2004-4-16 22:40:00
Imports Autodesk.AutoCAD.ApplicationServices
Imports Autodesk.AutoCAD.DatabaseServices
Imports Autodesk.AutoCAD.Runtime
Imports Autodesk.AutoCAD.Interop
Imports Autodesk.AutoCAD.Geometry
Imports DBTransMan = Autodesk.AutoCAD.DatabaseServices.TransactionManager
Public Class TLCad
<CommandMethod("test")> Public Shared Sub MytestCmd()
Dim db As Database = Application.DocumentManager.MdiActiveDocument.Database
Dim tm As DBTransMan = db.TransactionManager
Dim myT As Transaction = tm.StartTransaction()
Try
Dim line As New Line(New Point3d(0, 0, 0), New Point3d(1, 1, 0))
Dim bt As BlockTable = CType(tm.GetObject(db.BlockTableId, OpenMode.ForRead, False), BlockTable)
Dim btr As BlockTableRecord = CType(tm.GetObject(bt(BlockTableRecord.ModelSpace), OpenMode.ForWrite, False), BlockTableRecord)
btr.AppendEntity(line)
tm.AddNewlyCreatedDBObject(line, True)
Dim tbl As RegAppTable = CType(myT.GetObject(db.RegAppTableId, OpenMode.ForWrite, False), RegAppTable)
Dim app As New RegAppTableRecord
app.Name = "test1"
tbl.Add(app)
tm.AddNewlyCreatedDBObject(app, True)
line.XData = New ResultBuffer( _
New TypedValue(CInt(DxfCode.ExtendedDataRegAppName), "test1"), _
New TypedValue(CInt(DxfCode.ExtendedDataAsciiString), "tlcad test"))
myT.Commit()
Finally
myT.Dispose()
End Try
End Sub
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;
}
cag
发表于 2004-4-22 15:05:00
用VB。Net 开发出来的程序是用dll作扩展名的?
是否只支持CAD2005,不支持2002吗?
雪山飞狐_lzh
发表于 2004-4-22 15:10:00
是的
happy362
发表于 2004-5-19 09:07:00
请问有相关的参考书卖没有
能不能给一个创建实体的例子,如 创建点线 注写文字等
在此谢谢啦
happy362
发表于 2004-5-19 09:17:00
已看到啦谢谢啦
happy362
发表于 2004-5-19 09:20:00
告诉大家一个好消息, cad2005中文正式版出来啦在
<A href="http://down.9iv.com/" target="_blank" >http://down.9iv.com/</A>
有得下,不过有点慢, 只能单线程下
我已下下来啦,很好用,绝对正式注册版
sujianyong
发表于 2004-6-3 10:38:00
我想请问怎样才能找到Objectarx,万分感谢
雪山飞狐_lzh
发表于 2004-6-3 19:56:00
to <A name=23818><FONT color=#000066><B>sujianyong</B></FONT></A>
论坛里太多了,不过还是贴过来
<A href="http://usa.autodesk.com/adsk/servlet/item?siteID=123112&id=785550" target="_blank" >http://usa.autodesk.com/adsk/servlet/item?siteID=123112&id=785550</A>