TheSwamp

Code Red => AutoLISP (Vanilla / Visual) => Topic started by: jaydee on September 22, 2011, 11:58:29 PM

Title: Why select by window part of a block and the block get selected
Post by: jaydee on September 22, 2011, 11:58:29 PM
Hi.
This little issue been bugging me for a while. and would like to ask is this a system variable or is it just the way cad operates.
Please see attached drawing if i cant explain it clearly.

Say a building as a block, and a node/point is part of the block, this point is miles away from the building, if i zoom into this point (only the point is visible on the screen) and select this point by "window selection" the point only,  the block will get selected. this normally would not  allow in window selection.

If you zoom into attached drawing circle 1 and erase "window selection"  just the circle 1, the block will get deleted (even through the base point no where near the window).

So is it possible to avoid this kind behavior??Thankyou
Title: Re: How to avoid accidentally erase/select this block by window selection
Post by: cmwade77 on September 23, 2011, 12:19:19 PM
Put the block on it's own layer and lock it.
Title: Re: How to avoid accidentally erase/select this block by window selection
Post by: jaydee on September 28, 2011, 02:57:52 AM
Yes, only if i knew the object i window select is part of a block.
My understanding is that window selection a block only possible if the block (block bounding box) is cover by the window.

Thankyou
Title: Re: How to avoid accidentally erase/select this block by window selection
Post by: Tharwat on September 28, 2011, 04:10:44 AM
Would this help you with it  ... ?

Code: [Select]
(defun c:TesT (/ ss e vl) (vl-load-com)
  ;; Tharwat 28. Sep. 2011 ;;
  (while
    (and
      (setq ss
             (car (nentsel "\n Select a point in a Block to delete :"))
      )
      (eq (cdr (assoc 0 (setq e (entget ss)))) "POINT")
    )
     (progn
       (vla-delete (vlax-ename->vla-object ss))
       (vla-regen (vla-get-activedocument (vlax-get-acad-object))
                  acAllViewports
       )
     )
  )
  (princ)
)

Tharwat
Title: Re: How to avoid accidentally erase/select this block by window selection
Post by: jaydee on September 28, 2011, 05:47:56 AM
Thankyou Tharwat.
Its not abpout deleting a point.

Its about why window selection part of a block possible???
See my drawing attachement in the first post.
If you zoom into any circle and window select a circle, the block will get selected only if the other part of the block not visisble on the screen.
That is why i would like to know why it behave like this?
Title: Re: Why select by window part of a block and the block get selected
Post by: irneb on September 28, 2011, 01:44:41 PM
Jaydee, unfortunately what you're seeing is how the window selection works. It selects everything inside the window, but ignores the case where a portion of that entity is off-screen. Usually you notice this with blocks, but it could also happen to text, regions, solids, hatches, etc. Basically anything which need not be continuous.

The only way to ensure this doesn't happen is to zoom extents before performing the window selection. But obviously this might be very difficult on large drawings.

Mind you, seeing as you're doing this in the lisp forum, you could always manually then exclude those entities which has a bounding box outside of the window coordinates.
Title: Re: Why select by window part of a block and the block get selected
Post by: jaydee on September 28, 2011, 06:02:16 PM
Thankyou irneb.
Now i know this is how acad select. Initially I throught there might be small chance its a system variable that control this behavior.
Title: Re: Why select by window part of a block and the block get selected
Post by: irneb on September 29, 2011, 02:25:29 AM
"Mate" ... I know the OP's post is a bit difficult to understand. Let me try to explain what happens. Say you've got a block with 2 non-connected portions in it. You zoom to see ONLY one of those portions on the screen. Then you select by WINDOW (i.e. left-to-right). You'll get the entire block selected even though part of it is outside the selection window, but off-screen.

Follow the notes in the attached drawing and you'll see what happens.
Title: Re: Why select by window part of a block and the block get selected
Post by: jaydee on September 29, 2011, 03:03:40 AM
Thankyou Irneb.
This is exactly what i was trying to explain.
I assume because not many people (including experience drafter) come across this issue.
Im generally come across them when tidying up incoming bind architectural drawings to be used as our xref overlay background.
Title: Re: Why select by window part of a block and the block get selected
Post by: irneb on September 29, 2011, 05:01:40 AM
Yep, I've also seen this happen a lot with xrefs. You zoom into a place to work on something, then when you select you accidentally pick the xref as well (even though you've used a window selection). Partly for this reason all my xrefs are always placed on their own layer(s), and then I lock those layers.

But I've found this same problem with hatches. Especially if someone's done say wall hatching over several walls in one go. But then it's a case of the opposite also causing a problem: you pick / cross the hatch in one wall, delete / modify it, only to find you've deleted / modified it at another wall as well.
Title: Re: Why select by window part of a block and the block get selected
Post by: Lee Mac on September 29, 2011, 08:36:46 AM
Trust me; I understand the perceived 'problem'.

What you both appear to be missing is the suggested 'solution'; is to STOP using a crossing window for your selection methods.
In this one simple change of procedure you 'solve' all of the problems described, with hatches, blocks, XREF's etc.

One simple change, and then magically no surprises when things you can't see get changed that you did not intend to.

OR

Keep using a crossing window for your selection, and dealing with the collateral damage from doing so.

This is the voice of a(n) experienced user of autocad going all the way back to version 2.x.

Michael,

I don't think you understand the behaviour of AutoCAD selection when objects are partially off-screen. When using a Window or Crossing selection, AutoCAD will only test those objects visible on screen to determine which objects should be selected.

Using a Crossing or Window selection makes no difference when part of the object is off-screen.

An Example:

(http://www.theswamp.org/lilly_pond/leemac/BlockWindowSelection.gif)

Notice that I use a Window Selection both times. However, the block is selected when all but the point is off-screen; i.e. when every part of the block visible on-screen lies inside the selection window.
Title: Re: Why select by window part of a block and the block get selected
Post by: irneb on September 29, 2011, 09:02:30 AM
Thanks Lee.

Just remembered where this happens even more prevalently: Dimensions.
Title: Re: Why select by window part of a block and the block get selected
Post by: mjfarrell on September 29, 2011, 09:37:48 AM
I do not get the same results in Civil 3D....with Civil 3D objects...interesting.
There is or was a variable for that...at some point.

I wonder if that was eliminated as the Implied window command was integrated?

I wonder IF it is/was one of these obsolete values of SORTENTS

0
 Turns off all object sorting
 
1
 Sorts for object selection
 
2
 Sorts for object snaps
 
4
 Obsolete, has no effect
 
8
 Obsolete, has no effect
 
16
 Sorts for REGEN commands
 
32
 Sorts for plotting
 
64
 Obsolete, has no effect
 
Title: Re: Why select by window part of a block and the block get selected
Post by: irneb on September 29, 2011, 10:35:53 AM
None of those seem to have any effect. I've tried all of them in turn using:
Code: [Select]
(setvar 'SortEnts (boole 6 (getvar 'SortEnts) 4))
(setvar 'SortEnts (logior (getvar 'SortEnts) 4))
Testing on a dimension as per my previous post in each instance. Then doing the same for 8 & 64, as well as all combinations of the 3. BTW, my sortents was originally set to 127 (i.e. all was turned on - even those obsolete ones). And that was on Vanilla 2011.

Actually it's a related problem to these:
http://www.cadtutor.net/forum/showthread.php?48832-Out-of-view-selection
http://www.cadtutor.net/forum/showthread.php?6450-Selecting-objects-using-window-selection-while-zooming

I'd actually like to know why your C3D works as I'd have wanted it to do. Does it only do so on C3D objects? Or on all vanilla objects as well?
Title: Re: Why select by window part of a block and the block get selected
Post by: Jeff H on September 29, 2011, 11:40:42 AM
"Mate" ... I know the OP's post is a bit difficult to understand. Let me try to explain what happens. Say you've got a block with 2 non-connected portions in it. You zoom to see ONLY one of those portions on the screen. Then you select by WINDOW (i.e. left-to-right). You'll get the entire block selected even though part of it is outside the selection window, but off-screen.

Follow the notes in the attached drawing and you'll see what happens.

Here is a little something
 
 
Title: Re: Why select by window part of a block and the block get selected
Post by: irneb on September 29, 2011, 12:14:51 PM
Now that's interesting. Do you know what this "reference counter" is so I can set it to 0 somewhere? Actually reading that lot, it seems to be a variable inside the acet_SSGet function which gets turned on if the :n switch is used. So it only affects programatically selecting nested entities.
Title: Re: Why select by window part of a block and the block get selected
Post by: jaydee on September 29, 2011, 09:51:32 PM
Thankyou all.
It could save me some explaining if i could utilise these video captures.
1 picture = 10000 words.

May i ask what video/screen captures software do you guys used or recommend???.
Title: Re: Why select by window part of a block and the block get selected
Post by: Jeff H on September 29, 2011, 10:06:28 PM
If you have windows 7 then you can use snipping tool
 
 
Title: Re: Why select by window part of a block and the block get selected
Post by: irneb on September 30, 2011, 01:01:14 AM
For mine I used CamStudio to make an AVI, then opened that in VirtualDub and exported to GIF. Then used A Smaller GIF to make it about 30% of the original size. The 1st 2 are free, the last costs very little.

You could also go with something like Camtasia Studio which can do all those steps in one, though it costs a bit. I did it on XP so didn't have snip available, didn't know it did video capture, will have to investigate!
Title: Re: Why select by window part of a block and the block get selected
Post by: Lee Mac on September 30, 2011, 07:49:06 AM
May i ask what video/screen captures software do you guys used or recommend???.

http://www.theswamp.org/index.php?topic=38447.0 (http://www.theswamp.org/index.php?topic=38447.0)