ScmTools 发表于 2013-4-28 12:56:59

ARX函数给Lisp调用实例

本帖最后由 ScmTools 于 2013-5-5 15:42 编辑

Lisp中调用ARX函数实例

(defun c:test ( / i lst pt pt1 pts s1 ss)
(if (setq ss (ssget '((0 . "*POLYLINE"))))
    (progn
      (setq i -1)
      (while (setq s1 (ssname ss (setq i (1+ i))))
      (setq lst (Get_PointList s1))
      (setq pts nil)
      (foreach pt1 lst
          (setq pts (cons (append
                            (list (car pt1) (cadr pt1))
                        ) pts
                  )
          )
      )
      (entmake (append
                   (list '(0 . "LWPOLYLINE") '(62 . 6) '(100 . "AcDbEntity") '
                         (100 . "AcDbPolyline") (cons 90 (length pts))
                   )
                   (mapcar
                     '(lambda (pt)
                        (cons 10 pt)
                      )
                     pts
                   )
               )
      )
      )
      (vl-cmdf "_erase" ss "")
    )
)
(princ)
)

下面是调用的ARX函数
**** Hidden Message *****

sicky111 发表于 2013-5-1 01:03:49

原来还可以这样啊。

ScmTools 发表于 2013-5-1 09:17:35

ARX和LISP之间可以很好的相互调用函数

XD0001 发表于 2013-5-1 13:11:36

这个例子很经典

MoldTL 发表于 2013-5-1 13:42:51

必须支持,正好在学习这方面的

FlyBird888 发表于 2013-5-1 13:54:38

例子很经典,必须支持一个

JackTool 发表于 2013-5-1 14:17:15

很好的例子,支持一个

GTJ116600 发表于 2013-5-2 16:07:05

我也学习学习

GTJ116600 发表于 2013-5-2 16:20:34

各位大侠,怎么使用呀?我是菜鸟,看不懂呀
另外,lisp程序中调用的是get_pointlist 函数,ARX中是ads_Get_PointList(void)
,是不是笔误呀?另ARX函数是不是要编译成ARX在调用呀

Gdlprfcu 发表于 2013-5-4 23:46:11

请问如何返回一个选择集给LISP调用?

Gdlprfcu 发表于 2013-5-4 23:46:30

请问如何返回一个选择集给LISP调用?

LoveArx 发表于 2013-5-4 23:55:49

Gdlprfcu 发表于 2013-5-4 23:46 static/image/common/back.gif
请问如何返回一个选择集给LISP调用?


acedRetName Global Function int

acedRetName(

const ads_name aname,

int type);

aname Selection set or entity name
type Pass RTPICKS if aname to specify a selection set or RTENAME if aname to specify an entity

Returns a selection set or entity name to AutoLISP, depending on the value of the type argument.

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.

Include File
acedads.h

Gdlprfcu 发表于 2013-5-5 00:08:19

LoveArx 发表于 2013-5-4 23:55 static/image/common/back.gif


Thank you very much!

守仁格竹GM 发表于 2013-5-15 17:19:30

学习学习

/mg爱因思考 发表于 2013-6-8 23:49:22

页: [1] 2
查看完整版本: ARX函数给Lisp调用实例