Author Topic: Using variables in extended entity data  (Read 1265 times)

0 Members and 1 Guest are viewing this topic.

Prickle Farmer

  • Newt
  • Posts: 33
  • 35+ years of AutoCAD / BricsCAD
Using variables in extended entity data
« on: June 21, 2018, 04:14:52 AM »
The following line is supposed to have a value put in where hand is.

(setq newent '((-3 ("HIMS" (1000 . hand)))))

The value of newent end up as ((-3 ("HIMS" (1000 . HAND))))

I don't want HAND to be literal. I want to use a variable.  I know it has something to do with the quote but don't know how to resolve it. :x :x
I'd rather have a bottle in front of me than a frontal lobotomy.

Coder

  • Swamp Rat
  • Posts: 827
Re: Using variables in extended entity data
« Reply #1 on: June 21, 2018, 04:57:19 AM »
Read about LIST function and it may help.

Marc'Antonio Alessi

  • Swamp Rat
  • Posts: 1451
  • Marco
Re: Using variables in extended entity data
« Reply #2 on: June 21, 2018, 06:29:48 AM »
Comando: (setq hand 99999)
99999

Comando: (setq newent '((-3 ("HIMS" (1000 . hand)))))
((-3 ("HIMS" (1000 . HAND))))

Comando: (setq newent (list (list -3 (list "HIMS" (cons 1000 hand)))))
((-3 ("HIMS" (1000 . 99999))))


Prickle Farmer

  • Newt
  • Posts: 33
  • 35+ years of AutoCAD / BricsCAD
Re: Using variables in extended entity data
« Reply #3 on: June 21, 2018, 06:04:31 PM »
Create the list rather than quote the list structure.  I get it. Thanks people.
I'd rather have a bottle in front of me than a frontal lobotomy.

Lee Mac

  • Seagull
  • Posts: 12906
  • London, England
Re: Using variables in extended entity data
« Reply #4 on: June 21, 2018, 06:48:30 PM »
This explanation may help with your understanding.

Prickle Farmer

  • Newt
  • Posts: 33
  • 35+ years of AutoCAD / BricsCAD
Re: Using variables in extended entity data
« Reply #5 on: June 29, 2018, 02:11:33 AM »
Thanks Lee. Awesome as always.
I'd rather have a bottle in front of me than a frontal lobotomy.