CAD Forums > CAD General

Error: no function definition: VLAX-ENAME->VLA-OBJECT

(1/1)

HasanCAD:
Hi All,

I moved to new company, and they are using CAD2019.
While running a lisp gives this error

--- Code: ---"Error: no function definition: VLAX-ENAME->VLA-OBJECT"
--- End code ---
I found this is a bug in CAD19 and needs to modify in register, but IT refuse to solve this issue and saying we can't modify the register.
So is there any other solution to solve this issue without modifying in register.
for example:

--- Code - Auto/Visual Lisp: ---(defun _value   (str / )  (while    (not      (if (and (setq entt (nentsel str))               (setq ATTr (car entt))               (member (vla-get-objectname (setq ATTr (vlax-ename->vla-object ATTr)))                       '("AcDbAttribute" "AcDbText" "*DIM*" "AcDbMText")))        ATTr (progn (princ str) nil))))  ATTr  )
Thanks

It's Alive!:
maybe something like  :mrgreen:


--- Code - Auto/Visual Lisp: ---(vla-get-objectname (vlax-invoke-method (vla-get-activedocument (vlax-get-acad-object))     'HandleToObject (vlax-make-variant (cdr (assoc 5 (entget  (car (entsel))))) vlax-vbString))) 
or maybe

--- Code - Auto/Visual Lisp: ---(cdr(assoc 100 (reverse(entget(car (entsel)))))) 

tombu:
Are you running AutoCAD 2019 on a MacOS?

ronjonp:

--- Code - Auto/Visual Lisp: ---;; Change this(member (vla-get-objectname (setq attr (vlax-ename->vla-object attr)))        '("AcDbAttribute" "AcDbText" "*DIM*" "AcDbMText"));; to this(wcmatch (cdr (assoc 0 (entget attr))) "ATTRIB,*DIM*,*TEXT")It will return an ename rather vla object but you can still retrieve the "_value". Not sure why we're checking for *DIM*, if selecting text within a dimension it will return MTEXT.

Navigation

[0] Message Index

Go to full version