TheSwamp

Code Red => VB(A) => Topic started by: Atook on November 17, 2006, 12:38:20 PM

Title: Selection needs to be visible on screen?
Post by: Atook on November 17, 2006, 12:38:20 PM
It seems that for objects to be selected in VB(A) that they need to be entirely visible on screen.

       objSetLaterals.SelectByPolygon acSelectionSetFence, arr3DVertices, FilterType, FilterData

In the previous code, I get only select entities that are entirely visible on screen. If I zoom extents before I run the code, I get all of the entities crossing the fence.

Is there a way to get all of the entities without having them visible on the screen?

If there's no way to do this with VB(A) I'm open to other methods. :)
Title: Re: Selection needs to be visible on screen?
Post by: ronjonp on November 17, 2006, 01:09:48 PM
As far as I know, it's a known issue with AutoCAD and I have not found a work-around. Lisp selection shows the same behavior.


'er where  :-)
Title: Re: Selection needs to be visible on screen?
Post by: LE on November 17, 2006, 01:48:23 PM
It is possible, I did it in the looong past using logical filters, but for some reason cannot find any of my samples...

Here is a link to MASTER John Uhden (Hey John were are you?)

http://www.cadlantic.com/Freebies.htm

And look for the ssgetends.zip - I think it will give you an idea - if not, please ignore my post.  :-)
Title: Re: Selection needs to be visible on screen?
Post by: Keith™ on November 18, 2006, 12:28:35 AM
Using any selection method that requires a point to determine the boundary will result in a failed selection if the objects within the boundary are not currently visible on the screen. This includes objects that are on frozen and off layers, or that have had their visibility set to off. For those entities, you will need to select them using other methods such as selecting all objects in the drawing filtering for the ones you would like to grab.
Title: Re: Selection needs to be visible on screen?
Post by: Atook on November 20, 2006, 05:12:09 PM
Using any selection method that requires a point to determine the boundary will result in a failed selection if the objects within the boundary are not currently visible on the screen. This includes objects that are on frozen and off layers, or that have had their visibility set to off. For those entities, you will need to select them using other methods such as selecting all objects in the drawing filtering for the ones you would like to grab.

That's what I was worried about. *YUCK*

Thanks for the replies!
Title: Re: Selection needs to be visible on screen?
Post by: LE on November 20, 2006, 06:52:14 PM
Included is not the best sample, but give it a try is in plane jane lisp hth

Steps:
1. define points P1 P2 as they are in the drawing
2. zoom window to the rectangular area
3. load and run the command TST
4. zoom to extents and call the command SELECT P

Code: [Select]
(defun c:tst  (/ ss)
  (if (and (setq ss (ssget "X"
   (list
     '(-4 . "<AND")
     '(0 . "LINE")
     '(-4 . "AND>")
     '(-4 . "<AND")
     '(-4 . ">,>,*")
     (cons 10 p1)
     '(-4 . "<,<,*")
     (cons 10 p2)
     '(-4 . "AND>"))))
   (> (sslength ss) 0))
    (print (sslength ss))))