Tharwat Posted December 23, 2010 Posted December 23, 2010 I want to enter name of a Block and after that going to erase it by the command call as shown below . (defun c:test (/ e a ) (if (setq e (getstring "\n Enter Block name to delete :")) (progn (setq a (ssget "_x" '((0 . "INSERT")[color=red][b](cons 2 e)[/b][/color])))[b][color=red]<- The problem is here[/color][/b] (command "_.erase" a "") ) (princ) ) (princ) ) Thanks Quote
Lee Mac Posted December 23, 2010 Posted December 23, 2010 Read this about the use of quoted statements, and see if you can come up with a solution. Quote
alanjt Posted December 23, 2010 Posted December 23, 2010 tharwat, I have to ask: what is the logic behind your variable naming? Quote
Tharwat Posted December 23, 2010 Author Posted December 23, 2010 I got it worked Lee. (defun c:test (/ e a ) (if (setq e (getstring "\n Enter Block name to delete :")) (progn (setq a (ssget "_x" (list '(0 . "INSERT")(cons 2 e)))) (command "_.erase" a "") ) (princ) ) (princ) ) Thanks Quote
Tharwat Posted December 23, 2010 Author Posted December 23, 2010 tharwat, I have to ask: what is the logic behind your variable naming? Nothing. So I would ask , what kind of sence does it give ? I would like to know your opinion. Quote
alanjt Posted December 23, 2010 Posted December 23, 2010 Nothing. So I would ask , what kind of sence does it give ? I would like to know your opinion. I just don't see how "e" correlates to a block name string (Why not something like s/str/string/b/blk/block/n/name?) or how "a" correlates to your selection set (Why not ss/selectionset?). It's your routine, I was just wondering how your defined variables relate to what they are defining. Quote
Lee Mac Posted December 23, 2010 Posted December 23, 2010 tharwat, I have to ask: what is the logic behind your variable naming? Its the brackets that confuse me... Quote
Tharwat Posted December 23, 2010 Author Posted December 23, 2010 I just don't see how "e" correlates to a block name string (Why not something like s/str/string/b/blk/block/n/name?) or how "a" correlates to your selection set (Why not ss/selectionset?). It's your routine, I was just wondering how your defined variables relate to what they are defining. Yeah .... that's the proper way in dealing with variable names and a good naming to return to when being in need of them . But for me , I used "e" as a matter of Entity to get . and for "a" as the first action to do within "progn" list . That's it . Quote
Tharwat Posted December 23, 2010 Author Posted December 23, 2010 Its the brackets that confuse me... Do not tell me it is the "insert tab" option ! !!! Quote
Lee Mac Posted December 23, 2010 Posted December 23, 2010 Do not tell me it is the "insert tab" option ! !!! Its more the alignment, try to align the closing parenthesis with the relevant expression - makes for easier reading. Quote
alanjt Posted December 23, 2010 Posted December 23, 2010 Yeah .... that's the proper way in dealing with variable names and a good naming to return to when being in need of them . But for me , I used "e" as a matter of Entity to get . and for "a" as the first action to do within "progn" list . That's it . Whatever tickles your pickle. Quote
Lee Mac Posted December 24, 2010 Posted December 24, 2010 Whatever floats your boat... Whatever tickles your pickle... Whatever next... Quote
alanjt Posted December 24, 2010 Posted December 24, 2010 Whatever next... I'm sure I'll come up with something else. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.