TheSwamp
Code Red => AutoLISP (Vanilla / Visual) => Topic started by: curmudgeon on July 20, 2009, 04:23:24 PM
-
I am wanting to attach a little xdata to some objects. I have read the tutorial on Afralisp, and several posts here.
my needs are quite simple, really.
I think I am understanding that the (1002 . "{") and (1002 . "}") codes are used to nest a list. but why you would want to escapes me.
unless it is to fit a schema?
I am wanting to attach one piece of text and one integer to electrical devices to represent the circuit number and number of watts associated with each entity. then I can select each device by circuit number, and sum the wattages in the panel. pretty simple, really helpful.
just don't see why I would need to group two or three items in a nested list.
???
-
ust don't see why I would need to group two or three items in a nested list.
I think you don't need to, you just can do it if you want
-
Like Gile said, the facility is there is you need it. For simple data structure it's overkill IMO. Unless something I write is intended to be publicly consumable or it would benefit from the stratification I don't bother. However, it's good to get used to using them, particularly parsing data that uses it, as it's very common in the industry, typically pairing descriptor keys with values within a "{" "}" sentinel pair.
Some typical Autoplant xdata to illuminate:
(-3
( "AT_GRP"
(1002 . "{")
(1000 . "MT")
(1000 . "MS")
(1002 . "}")
(1002 . "{")
(1000 . "GN")
(1000 . "AT_FRJ70QGI_9RI")
(1002 . "}")
)
( "AT_COMP"
(1002 . "{")
(1000 . "MDL")
(1000 . "Base")
(1002 . "}")
(1002 . "{")
(1000 . "CLS")
(1000 . "AT_PIPE_BEND")
(1002 . "}")
(1002 . "{")
(1000 . "SPC")
(1000 . "BRZ")
(1002 . "}")
(1002 . "{")
(1000 . "STB")
(1000 . "PIPE")
(1002 . "}")
...
)
...
)
-
many thanks.