Berior
Guest
Hello everyone,
today my 2015 autocad (I have windows 8.1 to 64bit) woke up typing the custom command sup returned this error:
no function definition: vlax-ename->vla-object
And yet I haven't made any changes anywhere. today I updated the video card... but I don't think you can interface with autocad until you recognize the command... this command automatically loads when autocad starts.
This is the lsp script, can you tell me what's wrong?
(defun c:sup (/ lay cms pt int block)
(vl-load-com)
;;(defun sup error(s)
;; (if (/= s "function cancelled")
;; (princ (strcated "\nerror: "s)))
;;; )
;; (if olderr (setq *error* olderr)
;;;(princ)
;;; )
(setq cmd (getvar "cmdecho")
lay(vla-add (vla-get-layers (vla-get-activedocument (vlax-get-acad-object)))) "sup")
)
(vla-put-color lay 6)
(setvar "cmdecho" 0)
(setq pt (getpoint "tocca un punto interno all'area."))
(vl-cmdf "_bpoly" pt "")
(setq ent (entlast)
block (vla-get-modelspace (vla-get-activedocument (vlax-get-acad-object)) (vlax-3d-point pt) "area_by" 1 1 1 0)
)
(vla-put-textstring (car (safearray-value (variant-value)))(rtos (vla-get-area (vlax-ename->vla-object ent))) 2 2))
(vla-put-textstring (cadr (safearray-value))(rtos (vla-getattributes block)))(vla-get-length (vlax-ename->vla-object ent)))2 2))
(vla-put-layer block "sup")
(setvar "cmdecho" cmd)
(princ)
)
today my 2015 autocad (I have windows 8.1 to 64bit) woke up typing the custom command sup returned this error:
no function definition: vlax-ename->vla-object
And yet I haven't made any changes anywhere. today I updated the video card... but I don't think you can interface with autocad until you recognize the command... this command automatically loads when autocad starts.
This is the lsp script, can you tell me what's wrong?
(defun c:sup (/ lay cms pt int block)
(vl-load-com)
;;(defun sup error(s)
;; (if (/= s "function cancelled")
;; (princ (strcated "\nerror: "s)))
;;; )
;; (if olderr (setq *error* olderr)
;;;(princ)
;;; )
(setq cmd (getvar "cmdecho")
lay(vla-add (vla-get-layers (vla-get-activedocument (vlax-get-acad-object)))) "sup")
)
(vla-put-color lay 6)
(setvar "cmdecho" 0)
(setq pt (getpoint "tocca un punto interno all'area."))
(vl-cmdf "_bpoly" pt "")
(setq ent (entlast)
block (vla-get-modelspace (vla-get-activedocument (vlax-get-acad-object)) (vlax-3d-point pt) "area_by" 1 1 1 0)
)
(vla-put-textstring (car (safearray-value (variant-value)))(rtos (vla-get-area (vlax-ename->vla-object ent))) 2 2))
(vla-put-textstring (cadr (safearray-value))(rtos (vla-getattributes block)))(vla-get-length (vlax-ename->vla-object ent)))2 2))
(vla-put-layer block "sup")
(setvar "cmdecho" cmd)
(princ)
)