Author Topic: Error: no function definition: VLAX-ENAME->VLA-OBJECT  (Read 2967 times)

0 Members and 1 Guest are viewing this topic.

HasanCAD

  • Swamp Rat
  • Posts: 1420
Error: no function definition: VLAX-ENAME->VLA-OBJECT
« on: December 26, 2022, 04:35:44 AM »
Hi All,

I moved to new company, and they are using CAD2019.
While running a lisp gives this error
Code: [Select]
"Error: no function definition: VLAX-ENAME->VLA-OBJECT"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: [Select]
  1. (defun _value   (str / )
  2.   (while
  3.     (not
  4.       (if (and (setq entt (nentsel str))
  5.                (setq ATTr (car entt))
  6.                (member (vla-get-objectname (setq ATTr (vlax-ename->vla-object ATTr)))
  7.                        '("AcDbAttribute" "AcDbText" "*DIM*" "AcDbMText")))
  8.         ATTr (progn (princ str) nil))))
  9.   ATTr
  10.   )

Thanks

It's Alive!

  • Retired
  • Needs a day job
  • Posts: 8661
  • AKA Daniel
Re: Error: no function definition: VLAX-ENAME->VLA-OBJECT
« Reply #1 on: December 26, 2022, 06:24:56 AM »
maybe something like  :mrgreen:

Code - Auto/Visual Lisp: [Select]
  1.      'HandleToObject (vlax-make-variant (cdr (assoc 5 (entget  (car (entsel))))) vlax-vbString)))
  2.  

or maybe
Code - Auto/Visual Lisp: [Select]
  1.  
« Last Edit: December 26, 2022, 07:02:25 AM by Nigel Tufnel »

tombu

  • Bull Frog
  • Posts: 288
  • ByLayer=>Not0
Re: Error: no function definition: VLAX-ENAME->VLA-OBJECT
« Reply #2 on: January 02, 2023, 10:34:01 PM »
Are you running AutoCAD 2019 on a MacOS?
Tom Beauford P.S.M.
Leon County FL Public Works - Windows 7 64 bit AutoCAD Civil 3D

ronjonp

  • Needs a day job
  • Posts: 7526
Re: Error: no function definition: VLAX-ENAME->VLA-OBJECT
« Reply #3 on: January 03, 2023, 10:58:18 AM »
Code - Auto/Visual Lisp: [Select]
  1. ;; Change this
  2. (member (vla-get-objectname (setq attr (vlax-ename->vla-object attr)))
  3.         '("AcDbAttribute" "AcDbText" "*DIM*" "AcDbMText")
  4. )
  5. ;; to this
  6. (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.
« Last Edit: January 03, 2023, 11:04:49 AM by ronjonp »

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC