PDA

View Full Version : ssget "X" vs ssget "_X" - what's the difference


mark_hartman
2008-02-25, 08:43 PM
please help me understand
ssget "X" vs ssget "_X" - what's the difference

.T.
2008-02-25, 09:08 PM
please help me understand
ssget "X" vs ssget "_X" - what's the difference

Hi Mark, and welcome to AUGI.

The underscore allows the automatic translation of commands and keywords that follow it for versions that are not in english.

HTH

mark_hartman
2008-02-25, 10:09 PM
thank you Alaska

CADmium
2008-02-25, 10:11 PM
please help me understand
ssget "X" vs ssget "_X" - what's the difference

Please, use the international commands in your lisp, not all people have an english Autocad-Version!

mark_hartman
2008-02-25, 10:38 PM
will do, thanks

mark_hartman
2008-02-25, 11:10 PM
can anyone tell me what the '( and the associated ) do in this routine? I thought it had something to do with a transparent command but I am not sure. Also, where can I look up these codes on my own?

(command "._erase" (ssget "_X" '((0 . "WIPEOUT"))) "")

Opie
2008-02-25, 11:46 PM
Usually from the help menu. There should be a link in the Contents pane to "AutoLISP, Visual LISP, and DXF" help.

.T.
2008-02-25, 11:47 PM
can anyone tell me what the '( and the associated ) do in this routine? I thought it had something to do with a transparent command but I am not sure. Also, where can I look up these codes on my own?

(command "._erase" (ssget "_X" '((0 . "WIPEOUT"))) "")

'((0 . "WIPEOUT")) is telling the ssget function to filter out (not select) anything that isn't a wipeout.

Look up the ssget function in the Developer's Guide (Help->Additional Resources->Developer Help [I'm not sure if this is the case for all versions/verticals; you might have to search a bit]).

Also, the (0 . blahblah) is a dxf code and value. Look in the same Developer's Guide for the DXF Reference section.

mark_hartman
2008-02-26, 12:12 AM
Thank you very much! I greatly appreciate your help and promise I'll do my homework.

irneb
2008-02-26, 06:20 AM
can anyone tell me what the '( and the associated ) do in this routine? I thought it had something to do with a transparent command but I am not sure. Also, where can I look up these codes on my own?

(command "._erase" (ssget "_X" '((0 . "WIPEOUT"))) "")The apostrophe '(...) is a shortcut way of typing (quote ...). It's usually used to create a list, but there's other uses as well. The apostrophe used at the command prompt is something entirely different (not part of LISP) - you're right about it being used for transparent commands, but it has a different meaning when used in LISP.

BTW, you may have noticed the dot in the above. This ensures that the standard ERASE command is used, even if it was redefined in some other list instruction, e.g. having a (defun c:erase() ...) would make a new command overriding the standard ERASE, but then using (command "._erase" ...) ensures that you use the translated "true" erase command.

mark_hartman
2008-02-26, 05:09 PM
Thank you for educating me, I appreciate it.

irneb
2008-02-27, 05:50 AM
It's a pleasure. That's why we're all here: to get better at it by learning from each other.