Author Topic: Error with Extended Entity Data  (Read 1291 times)

0 Members and 1 Guest are viewing this topic.

the7347

  • Guest
Error with Extended Entity Data
« on: December 19, 2014, 12:17:43 PM »
hello

I have a problem trying to extend the data of an entity

this error when trying to create a list with a string entered by the keyboard to a variable.
; error: bad DXF group: (-3 ("Extend" (1000 . customName)))

if I change the line (1000. CustomName) by (1000. "CustomName")
everything works, but what I need is to enter from the keyboard

the example I found here
http://www.afralisp.net/autolisp/tutorials/extended-entity-data-part-1.php

Please I need help with this has given me many problems . . .

This is the code:
Code - Auto/Visual Lisp: [Select]
  1. (defun C:test (/ customName EntName )
  2.         (setq customName (getstring "Name of Entity: "))
  3.         (regapp "Extend")
  4.         (setq oldlist (entget (car (entsel))))
  5.         (setq thedata
  6.                 '((-3 ("Extend"
  7.                                 (1000 . customName)
  8.                 )))
  9.         )
  10.  
  11.         (setq newlist (append oldlist thedata))
  12.         (entmod newlist)
  13.         (setq elist (entget (car (entsel)) '("Extend")))
  14.         (setq exlist (assoc -3 elist))
  15.         ;(print(setq exlist (assoc -3 elist)))
  16.         (setq thexdata (car (cdr exlist)))
  17.                
  18.         (setq EntName (cdr (nth 1 thexdata)))
  19.         (alert (strcat
  20.                                 "Custom EntName: " EntName
  21.                         ))
  22. )

Marc'Antonio Alessi

  • Swamp Rat
  • Posts: 1454
  • Marco
Re: Error with Extended Entity Data
« Reply #1 on: December 19, 2014, 12:51:05 PM »
try this:
(setq thedata  (list (list -3 (list "Extend" (cons 1000 customName)))))

the7347

  • Guest
Re: Error with Extended Entity Data
« Reply #2 on: December 19, 2014, 02:00:07 PM »
thanks i run this resolved :-D