Welcome,
Guest
. Please
login
or
register
.
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
News:
Home
Help
Login
Register
TheSwamp
»
Code Red
»
AutoLISP (Vanilla / Visual)
»
Topic:
Error with Extended Entity Data
« previous
next »
Print
Pages: [
1
] |
Go Down
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]
(
defun
C:test
(
/
customName EntName
)
(
setq
customName
(
getstring
"Name of Entity: "
)
)
(
regapp
"Extend"
)
(
setq
oldlist
(
entget
(
car
(
entsel
)
)
)
)
(
setq
thedata
'
(
(
-
3
(
"Extend"
(
1000
. customName
)
)
)
)
)
(
setq
newlist
(
append
oldlist thedata
)
)
(
entmod
newlist
)
(
setq
elist
(
entget
(
car
(
entsel
)
)
'
(
"Extend"
)
)
)
(
setq
exlist
(
assoc
-
3
elist
)
)
;(print(setq exlist (assoc -3 elist)))
(
setq
thexdata
(
car
(
cdr
exlist
)
)
)
(
setq
EntName
(
cdr
(
nth
1
thexdata
)
)
)
(
alert
(
strcat
"Custom EntName: "
EntName
)
)
)
Logged
Marc'Antonio Alessi
Swamp Rat
Posts: 1454
Marco
WWW
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)))))
Logged
https://sites.google.com/view/alessimarcantonio/home
Coding manual:
https://tinyurl.com/y643cva6
https://www.facebook.com/alessicad
https://www.linkedin.com/in/marc-antonio-alessi-451959118/
the7347
Guest
Re: Error with Extended Entity Data
«
Reply #2 on:
December 19, 2014, 02:00:07 PM »
thanks i run this resolved
Logged
Print
Pages: [
1
] |
Go Up
« previous
next »
TheSwamp
»
Code Red
»
AutoLISP (Vanilla / Visual)
»
Topic:
Error with Extended Entity Data