- UID
- 14
- 积分
- 8264
- 精华
- 贡献
-
- 威望
-
- 活跃度
-
- D豆
-
- 在线时间
- 小时
- 注册时间
- 2002-1-4
- 最后登录
- 1970-1-1
|
发表于 2003-2-19 22:06:17
|
显示全部楼层
(vla-get-objectid (vlax-ename->vla-object (car (entsel)))) 可以得到对象的ID
Obtaining One Object Identifier from Another You may find the same drawing object represented by different identifiers and data types such as a handle string, an ename, a VLA-object, or an ARX object ID integer. To obtain the identifier with the data type your program requires, use the following strategies:
To find the handle associated with an ename, use the DXF 5 group of the ename's association list:
_$ (setq handle-circle (cdr (assoc 5 (entget ename-circle))))
"4F"
To find the ename associated with a handle, use the handent function:
_$ (handent handle-circle)
<Entity name: 27f0538>
To find the VLA-object associated with a handle, use the vla-handleToObject function:
_$ (setq vla-circle (vla-handleToObject acadDocument
handle-circle))
#<VLA-OBJECT IAcadCircle 03642c24>
To find the handle associated with a VLA-object, use vla-get-handle to obtain the handle property:
_$ (vla-get-handle vla-circle)
"4F"
To find the ARX Object ID of a VLA-object, use vla-get-objectid to get the objectID property:
_$ (setq objid-Circle (vla-get-objectid vla-circle))
41878840
To find the VLA-object identified by an ARX Object ID, use the ObjectID-toObject method on the AutoCAD Document object:
_$ (vla-ObjectIDtoObject acadDocument objid-circle)
#<VLA-OBJECT IAcadCircle 03642c24> |
|