Lisp Error for Mac

Lisp Error for Mac

Anonymous
Not applicable
947 Views
1 Reply
Message 1 of 2

Lisp Error for Mac

Anonymous
Not applicable

Hello,

 

When I used Auto Cad for window, I could use this lisp which is calculate area (m2)

However, I can't use it after changing version from window 2017 to Auto Cad 2017 for Mac

 

If I input this lisp, It occurs error message in the command window

(Command: AQ ; error: no function definition: VLAX-GET-ACAD-OBJECT)

 

Other lisp are activated successfully excepted the calculating area lisp.

Could you help me to solve this problem? 

 

You can check the are lisp 

Please, revise the text for mac version.

--------------

 

 

(defun c:aq( / doc space ss index obj mi mx minpt maxpt inspt area txtobj )
 (setvar "cmdecho" 0)
  (setq doc (vla-get-activedocument (vlax-get-acad-object)))
  (cond
    ((= (vla-get-activespace doc) 1) (setq space (vla-get-modelspace doc)))
    ((= (vla-get-activespace doc) 0) (setq space (vla-get-paperspace doc)))
    )
  (if (setq ss (ssget (list (cons 0 "CIRCLE,ARC,*POLYLINE,LINE,ELLIPSE,SPLINE"))))
    (if (or (setq ts (getreal (strcat "\n텍스트 높이 입력 <" (vl-princ-to-string (getvar "textsize")) ">:"))) (setq ts (getvar "textsize")))
      (progn
  (setvar "textsize" ts)
 (setq index 0)
 (repeat (sslength ss)
   (setq obj (vlax-ename->vla-object (ssname ss index)))
   (vla-getboundingbox obj 'mi 'mx)
   (setq minpt (vlax-safearray->list mi) maxpt (vlax-safearray->list mx))
   (setq inspt (polar minpt (angle minpt maxpt) (/ (distance minpt maxpt) 2)))
   (setq inspt (list (car inspt) (+ (cadr inspt) (* ts 2))))
   (setq area (vla-get-area obj)) ;len (vlax-curve-getdistatparam obj (vlax-curve-getendparam obj)))
    (setq a "면적(㎡)  : "  b (rtos (/ area 1000000.) 2 3) )
       (setq p (vlax-3d-point inspt))
       (setq txtobj (vla-addtext space (strcat a b) p ts))
       (vla-put-alignment txtobj 4)
       (vla-put-textalignmentpoint txtobj p)
       (setq inspt (polar inspt (/ (* 270 pi) 180) (* ts 2)))
 
   (setq index (1+ index))
   )
 ;(command "chprop" (ssget "x" '((0 . "TEXT") (1 . "평*"))) "" "c" "7" "")
 )
      )
    )
  (princ)
  )
(vl-load-com)
(prompt "\n[ AQ ]")  ;; 여기를 수정하시면 리습로드시 명령어가 나옵니다 ^^;;
(princ)

 

 

 

 

0 Likes
948 Views
1 Reply
Reply (1)
Message 2 of 2

martti.halminen
Collaborator
Collaborator

VLA- and VLAX- functions are for operations using ActiveX. That is not supported at all on Mac AutoCAD, so you need to re-write the whole program to use either ENTGET and relatives or getpropertyvalue, setpropertyvalue etc.

 

-- 

0 Likes