- ;(setq startPnt(vlax-make-safearray vlax-vbDouble '(0 . 2)))
- ;(vlax-safearray-fill startPnt st_point)
- ;(setq endPnt(vlax-make-safearray vlax-vbDouble '(0 . 2)))
- ;(vlax-safearray-fill endPnt p3)
- ;(setq Line_Obj(vla-AddLine mSpace startPnt endPnt))
- (vl-load-com )
- ;(vlax-dump-object(vlax-ename->vla-object(car(entsel)))T) (entget(car(entsel))'("*"))
- ;(setq xtype (vlax-make-safearray vlax-vbvariant '(0 . 1)))
- (setq xtype (vlax-make-safearray vlax-vbInteger '(0 . 1)))
- (setq xdata (vlax-make-safearray vlax-vbvariant '(0 . 1)))
- (vlax-safearray-fill xtype '(1001 1000))
- (vlax-safearray-fill xdata '("loop" "loop"))
- (vla-setxdata (vlax-ename->vla-object(car(entsel))) xtype xdata)
- ;(-3 ("loop" (1000 . "loop")))
- (defun c:GetX (/ xType XData)
- (vl-load-com)
- (setq appid "south")
- (setq vlaobj (car(entsel"\\n)选择环:")))
- (cond ((= (type vlaObj) 'ENAME) (SETQ vlaObj (vlax-ename->vla-object vlaObj)))
- ((= (type vlaObj) 'VLA-OBJECT) (SETQ vlaObj vlaObj))
- (t (setq olderror *error*)))
- (vla-getxdata vlaObj appid 'xType 'xData) ;;此处监视时,其值为nil
- (mapcar '(lambda (key val) (cons key (VLAX-VARIANT-value val)))
- (vlax-safearray->list xType)
- (vlax-safearray->list xData)
- )
- )
- ;(VLAX-VARIANT-value (vlax-safearray->list xData))
- ; (apply 'append(mapcar '(lambda (x) (list (cdr x))) (mapcar '(lambda (key val) (cons key (VLAX-VARIANT-value val)))(vlax-safearray->list xType)(vlax-safearray->list xData)))) ;;; ("SOUTH" "202101")
- ;(apply 'append '(("SOUTH") ("202101")))
- ; (mapcar '(lambda (x) (append (cdr x))) '((1001 . "SOUTH") (1000 . "202101")) )
- ;注意APPID是一个已经注册的应用程序名称..是REGAPP以后的名称,是字符串.
- (defun zhnfbm (oldobj newobj / xType xData xType1 xData1)
- (vl-load-com)
- (setq appid "south")
- (vla-getxdata oldobj appid 'xType 'xData) ;;此处监视时,其值为nil
- (setq xType1 (vlax-safearray->list xType) )
- (setq xData1 (apply 'append(mapcar '(lambda (x) (list (cdr x))) (mapcar '(lambda (key val) (cons key (VLAX-VARIANT-value val)))(vlax-safearray->list xType)(vlax-safearray->list xData)))) )
- (setq xtype (vlax-make-safearray vlax-vbInteger '(0 . 1)))
- (setq xdata (vlax-make-safearray vlax-vbvariant '(0 . 1)))
- (vlax-safearray-fill xtype xType1)
- (vlax-safearray-fill xdata xData1)
- (vla-setxdata newobj xtype xdata)
-
- )
- ;; (zhnfbm (vlax-ename->vla-object(car(entsel))) (vlax-ename->vla-object(car(entsel))) )
|