Quick tip: entget’ing a tblobjname returns nil value. How to get around it?

<?xml encoding=”UTF-8″>By Gopinath Taget

Why is the return value of the (entget) function nil after updating dimension entities?

This happens because of a known problem with tlbobjname lisp function. Consider the following code:

(setq ent (entget (tblobjname "block" "*D1"))<br>        det (entget (cdr (assoc -2 ent)))<br>)<br>(print det)<br>

At the command prompt type the following:

Command: Dim

Dim: upd

Select objects: all

Select objects:

Now execute the above lisp code again and you will notice a nil return value.  This is due to the known problem with ‘tblobjname’ function.  The workaround is to use ‘tblsearch’ instead:

(setq ent (tblsearch "block"  "*D1")<br>        det (entget (cdr (assoc -2 ent)))<br>)<br>(print det)<br>

Comments

Leave a Reply

Discover more from Autodesk Developer Blog

Subscribe now to keep reading and get access to the full archive.

Continue reading