Double click Actions Problem
I need to use the following code in double click actions / Attribute Block / Edit Block Attributes / Command Section, but it does not work. Works in Autocad
^C^C((= (substr (cdr (assoc 2 (entget (ssname (ssget "P") 0)))) 1 6) "POSE") (c:rea) (command "_eattedit" ))
ERROR :
: ((= (substr (cdr (assoc 2 (entget (ssname (ssget "P") 0)))) 1 6) "POSE") (c:rea) (command "_eattedit" ))
; ----- Error around expression -----
; (SSGET "P")
;
; error : no function definition <(= (SUBSTR (CDR (ASSOC 2 (ENTGET (SSNAME (SSGET "P") 0)))) 1 6) "POSE")> ; expected FUNCTION at [eval]
^C^C((= (substr (cdr (assoc 2 (entget (ssname (ssget "P") 0)))) 1 6) "POSE") (c:rea) (command "_eattedit" ))
ERROR :
: ((= (substr (cdr (assoc 2 (entget (ssname (ssget "P") 0)))) 1 6) "POSE") (c:rea) (command "_eattedit" ))
; ----- Error around expression -----
; (SSGET "P")
;
; error : no function definition <(= (SUBSTR (CDR (ASSOC 2 (ENTGET (SSNAME (SSGET "P") 0)))) 1 6) "POSE")> ; expected FUNCTION at [eval]
0
Comments
-
Still no reply?0
-
Are you missing the 'if'?
(if (= (substr (cdr (assoc 2 (entget (ssname (ssget "P") 0)))) 1 6) "POSE") (c:rea) (command "_eattedit" ))0 -
:martin@enco.us said:Are you missing the 'if'?
(if (= (substr (cdr (assoc 2 (entget (ssname (ssget "P") 0)))) 1 6) "POSE") (c:rea) (command "_eattedit" ))
: (if (= (substr (cdr (assoc 2 (entget (ssname (ssget "P") 0)))) 1 6) "POSE") (c:rea) (command "_eattedit" ))
; ----- Error around expression -----
; (SSGET "P")
;
; error : bad argument type ; expected SELECTIONSET at [ssname]
still same problem0 -
I suggest filing a bug report.0
-
from error message, seems that (ssget "P") returns NIL (no previous set);
you might try to replace
(ssget "P")
with
(ssgetfirst)
?
many greetings !0 -
Thank you, but I get same errorTorsten Moses said:from error message, seems that (ssget "P") returns NIL (no previous set);
you might try to replace
(ssget "P")
with
(ssgetfirst)
?
many greetings !0 -
I think there is a fundamental flaw. You said this is for a double click action, which implies that you want to click on a block, read the attribute tag value, then either run c:rea or run the attribute editor.
(ssget "P") reads whatever the last selection was. You are clicking on one entity but the code is working on the first entity of the last selection set before the double click. You might want to use ENTSEL or try "_+.:E:S:L" instead of "P".
0 -
^C^C((= (substr (cdr (assoc 2 (entget (entsel "P") 0)))) 1 6) "POSE") (c:rea) (command "_eattedit" ))martin@enco.us said:I think there is a fundamental flaw. You said this is for a double click action, which implies that you want to click on a block, read the attribute tag value, then either run c:rea or run the attribute editor.
(ssget "P") reads whatever the last selection was. You are clicking on one entity but the code is working on the first entity of the last selection set before the double click. You might want to use ENTSEL or try "_+.:E:S:L" instead of "P".
It opens with the following code, but some variables can be fixed in the lispin. For example, I fixed the length of a line to pose. When the length of the line changes, it changes automatically, but when it works with this code, that function does not work, I guess because it does not get ssname.0