Author Topic: Selection set error ...  (Read 2141 times)

0 Members and 1 Guest are viewing this topic.

Hangman

  • Swamp Rat
  • Posts: 566
Selection set error ...
« on: February 23, 2010, 02:11:29 PM »
I am curious as to why I am receiving an error with this (supposably) simple piece of code.
Code: [Select]
(setq SS (ssget "_X" '(list (cons 0 "MTEXT,TEXT,DIMENSION,LEADER") (cons 410 (getvar 'CTAB)))))I just want to select the items on the current tab, be it in paper space or if I am in model space, then model space.
the error I get is this:
Quote
error: bad point argument
Hangman  8)

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

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Re: Selection set error ...
« Reply #1 on: February 23, 2010, 02:20:50 PM »
you're quoting a statement (hint: it won't be evaluated)
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst

Hangman

  • Swamp Rat
  • Posts: 566
Re: Selection set error ...
« Reply #2 on: February 24, 2010, 10:49:59 AM »
you're quoting a statement (hint: it won't be evaluated)
I guess I'm stuck on looking for the quoted statement.  I know this piece of code works;
Code: [Select]
(setq Dims (ssget "_X" '((0 . "DIMENSION,LEADER"))))A simple piece of code.  If I am understanding you, the quoted piece is "DIMENSION,LEADER".
Another piece of code I know works.
Code: [Select]
(setq Blocks (ssget "_X" (list (cons 0 "INSERT") (cons 410 (getvar 'CTAB)))))Here, the code is getting all blocks on the current tab.  The "INSERT" is quoted.
According to the help, I can add multiple elements to the quoted section.
So I guess my question(s) here then is this:  What statement is being quoting that keeps it from getting evaluated ??  Aren't the items being sought suppose to be in quotes ??
Thank you for you help.
Hangman  8)

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

T.Willey

  • Needs a day job
  • Posts: 5251
Re: Selection set error ...
« Reply #3 on: February 24, 2010, 10:59:38 AM »
What is the difference between your last coded piece of code, in you last post, and the first coded piece in your first post?

That will tell you what MP means.
Tim

I don't want to ' end-up ', I want to ' become '. - Me

Please think about donating if this post helped you.

Hangman

  • Swamp Rat
  • Posts: 566
Re: Selection set error ...
« Reply #4 on: February 24, 2010, 11:03:11 AM »
Doht ...
I think I just found what you were refering too.
Code: [Select]
(setq SS (ssget "_X" '(list (cons 0 "MTEXT,TEXT,DIMENSION,LEADER") (cons 410 (getvar 'CTAB)))))It is the single quote ( ' ) in front of the (list (cons ... you were speaking of, correct ?!.
OK, so, with that in mind, why does this piece of code need to be quoted,
Code: [Select]
(setq Dims (ssget "_X" '((0 . "DIMENSION,LEADER"))))and this following piece not ??
Code: [Select]
(setq Blocks (ssget "_X" (list (cons 0 "INSERT") (cons 410 (getvar 'CTAB)))))Is it because the first is a direct where the second is a list ??
Hangman  8)

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

Lee Mac

  • Seagull
  • Posts: 12922
  • London, England
Re: Selection set error ...
« Reply #5 on: February 24, 2010, 11:11:13 AM »

Hangman

  • Swamp Rat
  • Posts: 566
Re: Selection set error ...
« Reply #6 on: February 24, 2010, 11:22:40 AM »
Hangman  8)

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

Lee Mac

  • Seagull
  • Posts: 12922
  • London, England
Re: Selection set error ...
« Reply #7 on: February 24, 2010, 11:37:12 AM »
Thanks Hangman, glad you found it helpful   8-)