马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?立即注册
×
本帖最后由 Free-Lancer 于 2013-5-26 06:38 编辑
Question
I have to access XDatas inside a Visual LISP reactor, but I cannot use (entget)
or (entmod). Is it possible to use the (vla-getxxx) and (vla-setxxx) functions
to do this?
Answer
You can use the (vla-GetXData) and (vla-SetXData) functions. These functions are
not documented (as are most the Visual LISP online help).
To get more information about these functions, look at the function description
of GetXData and SetXData in the ACADAUTO.HLP help file (the AutoCAD ActiveX and
VBA Reference).
Here is a short description of the functions:
(vla-GetXData entity appName 'codes 'datas)
entity:
This is the entity name of an AutoCAD entity.
appName:
This is a string with the application name. The functions returns all XDatas
belonging to the specified application. If appName is "", the functions returns
all XDatas attached to 'entity'.
codes:
This list receives the XData group codes.
datas:
This list receives the datas of the group codes specified in 'codes'
(vla-SetXData entity codes datas)
entity:
This is the entity name of an AutoCAD entity.
codes:
This list defines the XData group codes.
datas:
This list contains the datas for the specified group codes
The following is a sample code which attaches some XData to every entity in
model space.After this, it extracts the XData of every entity from every
application:For additional AutoLISP code that creates and reads Xdata using ActiveX, see
the Xdata_Variants.Lsp sample in the
\Acad2000\Sample\VisualLisp directory.. |