几何尺寸与公差论坛------致力于产品几何量公差标准GD&T (GDT:ASME)|New GPS(ISO)研究/CAD设计/CAM加工/CMM测量

几何尺寸与公差论坛------致力于产品几何量公差标准GD&T (GDT:ASME)|New GPS(ISO)研究/CAD设计/CAM加工/CMM测量 (http://www.dimcax.com/hust/index.php)
-   ObjectARX(VB.NET/C#) (http://www.dimcax.com/hust/forumdisplay.php?f=176)
-   -   如果我调用同样的代码,在一页图中想画多个实体,这个块名应取什么?*u下面是代码 (http://www.dimcax.com/hust/showthread.php?t=9615)

yang686526 2009-04-21 11:29 AM

如果我调用同样的代码,在一页图中想画多个实体,这个块名应取什么?*u下面是代码
 
如果我调用同样的代码,在一页图中想画多个实体,这个块名应取什么?*u下面是代码
www.dimcax.com
如果我调用同样的代码,在一页图中想画多个实体,这个块名应取什么?*u下面是代码
<commandmethod("insertblocku")> _
public function insertblock() as objectid
dim db as database = hostapplicationservices.workingdatabase()
dim trans as transaction = db.transactionmanager.starttransaction()
dim bt as blocktable = trans.getobject(db.blocktableid, openmode.forwrite)
dim mybtrid as objectid
dim mybtrref as blockreference
' purgeblock("testblock") '将块清除掉重表改写块 根据块名
dim mybtr as blocktablerecord = new blocktablerecord()
mybtr.name = "*u"
dim line as line = new line(new point3d(-20, 0, 0), new point3d(20, 0, 0))
mybtr.appendentity(line)
dim circle as circle = new circle(new point3d(0, 0, 0), vector3d.zaxis, 10.0)
mybtr.appendentity(circle)
mybtr.origin = new point3d(-20, 0, 0)
mybtrid = bt.add(mybtr)
trans.addnewlycreateddbobject(mybtr, true)
mybtrref = new blockreference(new point3d(0, 0, 0), mybtrid)
dim btr as blocktablerecord = trans.getobject(bt(blocktablerecord.modelspace), openmode.forwrite)
btr.appendentity(mybtrref)
trans.addnewlycreateddbobject(mybtrref, true)
trans.commit()
trans.dispose()
return mybtrid
end function
好贴!
c#最适合开发autocad,因为它拥有vb容易的特点,却具有vc++的强大功能。
这个帖子是说匿名块的用途吧
哈哈!又验证了一句话,"试了就知道!"
你上面那个块名不用赋值,去掉那句就ok啦
[


所有的时间均为北京时间。 现在的时间是 11:14 AM.