首先,要用ADSRX结构,用ads_defun 定义外部函数,才能返回数据给LISP。
返回的方法:
ads_retname(ss,RTPICKS);
因为选择集和实体都使用了ads_name 类型,所以,加了RTPICKS 告诉ARX返回的是选择集
如果返回实体:
ads_retname(ent,RTENAME);

- [FONT=courier new]
- int
- acedRetName(
- const ads_name aname,
- int type);
- Include File
- acedads.h
- Returns a selection set or entity name, aname, to AutoLISP. The type argument must equal RTPICKS if aname specifies a selection set, or RTENAME if aname specifies an entity. The AutoLISP expression that invoked the external function returns the name result as built-in and user-defined AutoLISP functions do.
- An external function can make more than one call to value-return functions upon a single kInvkSubrMsg message, but the AutoLISP function returns only the value passed it by the last value-return function invoked.
- If acedRetName() succeeds, it returns RTNORM; it returns RTERROR if it fails or if aname is a null pointer.[/FONT]
|