TheSwamp

Code Red => AutoLISP (Vanilla / Visual) => Topic started by: Tortiz on June 10, 2013, 01:42:04 PM

Title: SSget help
Post by: Tortiz on June 10, 2013, 01:42:04 PM
I want to do a selected set per tab. somthing like:

(setq test (ssget "_x"))

but the documation I have do not have a filter for a tab.
Any Ideas?
Title: Re: SSget help
Post by: kpblc on June 10, 2013, 01:48:10 PM
http://docs.autodesk.com/ACD/2014/ITA/index.html?url=files/GUID-0F37CC5E-1559-4011-B8CF-A3BA0973B2C3.htm,topicNumber=d30e612896
http://www.afralisp.net/autolisp/tutorials/selection-sets.php

Plus don't forget about DXF Reference.
Title: Re: SSget help
Post by: CAB on June 10, 2013, 02:26:11 PM
Code - Auto/Visual Lisp: [Select]
  1. ;;  ****     C U R R E N T   S P A C E   O N L Y      ****
  2. ;;  Limit the _X filter to current tab model space which ever is active
  3. (setq ss (ssget "x" (list (cons 0 "*POLYLINE") (cons 410 (getvar "ctab")))))
Title: Re: SSget help
Post by: Tortiz on June 10, 2013, 03:05:33 PM
Thanks!!
Title: Re: SSget help
Post by: alanjt on June 10, 2013, 04:38:26 PM
To account for being in a viewport:

Code: [Select]
(if (eq (getvar 'CVPORT) 1)
  (cons 410 (getvar 'CTAB))
  '(410 . "Model")
)
Title: Re: SSget help
Post by: irneb on June 11, 2013, 03:27:11 AM
To account for being in a viewport:
Now that might be a difficult one! What if the user wanted to select all objects in MS which are visible through the current tab's viewports.
Title: Re: SSget help
Post by: alanjt on June 11, 2013, 07:36:21 AM
To account for being in a viewport:
Now that might be a difficult one! What if the user wanted to select all objects in MS which are visible through the current tab's viewports.
Do you mean only the objects visible within a viewport?
Title: Re: SSget help
Post by: irneb on June 12, 2013, 01:37:22 AM
Do you mean only the objects visible within a viewport?
Exactly. Which means you'd need the coordinates of the VP (or cropped vectors if so), and also the layers which aren't VP-Frozen.
Title: Re: SSget help
Post by: roy_043 on June 12, 2013, 03:53:09 AM
... and also the layers which aren't VP-Frozen.
Using (ssget "_A") solves this. Plus there is no need for a ctab filter.
Title: Re: SSget help
Post by: bruno_vdh on June 12, 2013, 04:29:13 AM
Hello,
Quote
Exactly. Which means you'd need the coordinates of the VP (or cropped vectors if so), and also the layers which aren't VP-Frozen.

To the game...
Code: [Select]
(ssget "_C" '(-1e99 -1e99) '(1e99 1e99))
Title: Re: SSget help
Post by: irneb on June 12, 2013, 06:54:13 AM
To the game...
Code: [Select]
(ssget "_C" '(-1e99 -1e99) '(1e99 1e99))
That's actually a very good idea. Thus you'd need to run the PSpace command, Zoom Extents, then run MSpace, then set CVport = 2, get that selection and increment until you don't have any more VP's, each time adding the selection for the current VP into the mix.

The only issue is it only works on normal rectangular VP's, if the object would have been visible in the VP's bounding box then it's selected - even if the VP's border hides the object. But I guess that's a bit overkill.
Title: Re: SSget help
Post by: alanjt on June 12, 2013, 07:50:04 AM
Hello,
Quote
Exactly. Which means you'd need the coordinates of the VP (or cropped vectors if so), and also the layers which aren't VP-Frozen.

To the game...
Code: [Select]
(ssget "_C" '(-1e99 -1e99) '(1e99 1e99))
Would you mind elaborating on this?
Title: Re: SSget help
Post by: Lee Mac on June 12, 2013, 08:00:15 AM
Hello,
Quote
Exactly. Which means you'd need the coordinates of the VP (or cropped vectors if so), and also the layers which aren't VP-Frozen.

To the game...
Code: [Select]
(ssget "_C" '(-1e99 -1e99) '(1e99 1e99))
Would you mind elaborating on this?

Using the idea that ssget graphical selection modes will only select objects currently visible on screen.
Title: Re: SSget help
Post by: bruno_vdh on June 12, 2013, 08:18:20 AM
Quote
The only issue is it only works on normal rectangular VP's, if the object would have been visible in the VP's bounding box then it's selected - even if the VP's border hides the object. But I guess that's a bit overkill.
Yes, the trick has its limitations, it was for the game

Quote
Would you mind elaborating on this?
I used this expression to amuse me in a code posted on the forum CADxp
http://cadxp.com/index.php?/topic/35882-modifier-temporairement-l%e2%80%99affichage-des-lignes-discontinues-en-continues/page__view__findpost__p__195201

Regards,
Title: Re: SSget help
Post by: CAB on June 12, 2013, 08:51:57 AM
Food for thought.  8)
http://www.theswamp.org/index.php?topic=9461.msg129670#msg129670

Title: Re: SSget help
Post by: alanjt on June 12, 2013, 08:57:32 AM
Hello,
Quote
Exactly. Which means you'd need the coordinates of the VP (or cropped vectors if so), and also the layers which aren't VP-Frozen.

To the game...
Code: [Select]
(ssget "_C" '(-1e99 -1e99) '(1e99 1e99))
Would you mind elaborating on this?

Using the idea that ssget graphical selection modes will only select objects currently visible on screen.
Right on. I thought as much, but wasn't 100%. Thanks.
Title: Re: SSget help
Post by: irneb on June 12, 2013, 09:35:48 AM
Food for thought.  8)
http://www.theswamp.org/index.php?topic=9461.msg129670#msg129670
Well then that code could be used to calculate the boundary of a CP selection. That would then probably do even the cropped VP's correctly.