Author Topic: Selecting everything on what tab ...  (Read 1304 times)

0 Members and 1 Guest are viewing this topic.

Hangman

  • Swamp Rat
  • Posts: 566
Selecting everything on what tab ...
« on: February 02, 2011, 02:21:28 PM »
I have a quick problem for anyone who can help me at the moment,

I have this:
Code: [Select]
(setq Drawing (ssget "_X" '((410 . (getvar 'CTAB)))))
and am getting this:
Quote
Application Error: 0 :- bad SSGET list value

I have tried this:
Code: [Select]
(setq Drawing (ssget "_X" (list (cons (410 . (getvar 'CTAB))))))
but have received this error:
Quote
Application Error: 0 :- bad function: 410

My main purpose here is to select all items on the current tab.  so if the artist went and put the entire drawing in paperspace so they don't have to deal with a viewport, I need to select the items on that tab (usually 'layout' but not always).

What is your suggestion for selecting everything on the current tab (be it Model or Layout or Border or whatever the name)?

Thanks.
Hangman  8)

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Drafting Board, Mechanical Arm, KOH-I-NOOR 0.7mm
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Lee Mac

  • Seagull
  • Posts: 12914
  • London, England
Re: Selecting everything on what tab ...
« Reply #1 on: February 02, 2011, 02:29:45 PM »
Code: [Select]
(setq Drawing (ssget "_X" (list (cons [color=red](410 . [/color](getvar 'CTAB))))))
Close...

But, since the expression containing 410 is unquoted, the symbol 410 is interpreted as a function.

Code: [Select]
(setq Drawing (ssget "_X" (list (cons 410 (getvar 'CTAB)))))
I did have a little description of how the apostrophe affects expressions, but its on CADTutor and, after trying to go back to the link, I got hit by AdobeReader opening and a Java Script running...  :x

Lee
« Last Edit: February 02, 2011, 02:35:34 PM by Lee Mac »

Hangman

  • Swamp Rat
  • Posts: 566
Re: Selecting everything on what tab ...
« Reply #2 on: February 02, 2011, 02:40:24 PM »
Code: [Select]
(setq Drawing (ssget "_X" (list (cons [color=red](410 . [/color](getvar 'CTAB))))))
Close...

But, since the expression containing 410 is unquoted, the symbol 410 is interpreted as a function.

Code: [Select]
(setq Drawing (ssget "_X" (list (cons 410 (getvar 'CTAB)))))
I did have a little description of how the apostrophe affects expressions, but its on CADTutor and, after trying to go back to the link, I got hit by AdobeReader opening and a Java Script running...  :x

Lee

Doht !!!

I fat-fingered the (410 . (get... (period), but the extra paren is where I screwed up.  Thanks Lee.
Hangman  8)

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Drafting Board, Mechanical Arm, KOH-I-NOOR 0.7mm
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~