I am having a problem with using fence-selection. If I zoom-out so far that I cannot see the color of the line that I use for fence-selection, I find that fence-selection cannot select the objects. If I zoom-in just a little bit to start seeing the color of the line, I find that fence-selection can select the objects.
This seems to suggest that zooming-in to the drawing is a workaround. Unfortunately this creates another problem. Let say the drawing has multiple lines for fence-selection, and the lines are in different areas of the drawing. If I zoom-in enough to see some lines, I find that some other lines will be scrolled outside the screen. When I try to do fence-selection, the lines scrolled outside the screen will not be able to select any object.
This means if I zoom-out, some lines become too small and invisible and will not select any object. On the other hand, if I zoom-in, some lines get scrolled out and they will not select any object either. This is the dilemma.
How can I tell AutoCAD to select objects using fence selection even when the fence line is too small and inivisble when I zoom out?
How can I tell AutoCAD to select objects using fence selection even when the fence line has been scrolled outside the screen?
Please help. Thanks in advance.
Jay Chan
Solved! Go to Solution.
Solved by marko_ribar. Go to Solution.
There was one correction to my original message. Contrary to what I said, I still can select some object using fence selection even though I have zoomed out. The problem is that not all the objects are selected. Let say the line crosses one piece of duct and also its piece number tag. The fence-selection can select the piece of duct but not its piece number tag if I zoom out. On the other hand, if I zoom-in just a bit, the fence-selection can select both the piece of duct and its piece number tag.
Further investigation finds that whether the fence-selection-line is visible or not doesn't affect the outcome. I have increased the line weight of the fence-selection-line to the point that I can still see the line when I zoom out, and I still have the problem. Therefore, the problem has to do with zooming out, not have to do with whether the line is visible or not.
Attached please find a drawing that shows this problem. The drawing has some objects in its 4 corners. In the lower left corner, there is a blue heavy line crossed over the piece number tag of a piece of duct. I expect fence-selection should be able to select both the piece number tag and the piece of duct because the line touches both. But I find that when I zoom out far enough, the fence-selection can only select the piece of duct, but not its piece number tag.
Attached please also find a LISP program called (Test_Fence_Select) that finds polylines already on the drawing, and then uses fence select to select objects on the drawing using the polylines. Finally, it shows the number of objects that it has found. If we zoom in close enough to the drawing, we should see the program can select 2 objects (the duct body and its piece number tag). If we zoom out far enough, we should see the program can select only 1 object (the duct body) and it fails to select the piece number tag.
The drawing was drawn using a third party software. But the problem is there regardless if I load or unload that third party software.
Please help. Thanks.
Jay Chan
Maybe this lisp can help...
(defun c:selfence ( / p pl pp zp ss ) (setq p (getpoint "\nPick or specify start point : ")) (setq pl (cons p pl)) (setq pp p) (while (and (not (initget 128) ) (if (or (listp pp) (not (or (wcmatch pp "C*") (wcmatch pp "c*")))) (setq pp (getpoint pp "\nPick or specify next point <Exit> (\"C\" - Close) : ")) (setq pp nil) ) ) (cond ( (listp pp) (setq pl (cons pp pl)) ) ( (or (wcmatch pp "C*") (wcmatch pp "c*")) (setq pl (cons p pl)) ) ) (mapcar '(lambda ( a b ) (grdraw a b 1 1)) pl (cdr pl)) ) (setq zp (acet-geom-list-extents pl)) (command "_.zoom" "_w" (car zp) (cadr zp)) (setq ss (ssget "_F" pl)) (sssetfirst nil ss) (princ) )
M.R.
Yes, setting Visual-Style to 2D-wireframe can workaround this problem. Do you know why the visual-style can make such a difference? I am trying to understand this to know if this is just a "workaround" or is really a "fix".
Please let me know. Thanks.
Attached please find the new version of the program that has the workaround. It also works around the problem of not correctly excluding polylines from the selection-set (now it filters by entity handle instead of entity name). Now, it should only show 2 objects selected, instead of 1 or 3.
Jay Chan
@Anonymous wrote:
Yes, setting Visual-Style to 2D-wireframe can workaround this problem. Do you know why the visual-style can make such a difference? I am trying to understand this to know if this is just a "workaround" or is really a "fix".
Please let me know. Thanks.
Attached please find the new version of the program that has the workaround. It also works around the problem of not correctly excluding polylines from the selection-set (now it filters by entity handle instead of entity name). Now, it should only show 2 objects selected, instead of 1 or 3.
Hi Jay Chan,
to use one of the graphical selection methods, we need to ensure that entities are visible on the screen, and using visual styles sometimes the result is not the desired one.
"now it filters by entity handle instead of entity name"
To filter by entity name, change
(/= entnameEntFS entnamePL)
to
(not (eq entnameEntFS entnamePL))
HTH
Henrique
Hi, Marko Ribar. Thanks for showing me your script. This points me to the right direction. The trick is to zoom into the area where the polyline is before I use the polyline to do fence-selection. I have incorporated that technique in my program and it works fine now.
Attached please find the updated test program that shows the way to use this technique to zoom into the polyline before using it to do fence-selection. The updated test program also incorporates the correct way to compare two entity names to see if they are equal or not that another forum member "hmsilva" has pointed out.
Thanks for the many helpful info that I have received here.
Jay Chan
@Anonymous wrote:
Thanks for the correction. I have tried the correct way of comparing two entity names. And you are right.
I have decided not to change the visual style to fix this problem because I don't fully understand why this technique works. I have decided to zoom into a polyline before I use it to do fence-selection. Thanks anyway.
You're welcome, Jay Chan.
Henrique
I have updated the test program. I have done this just in case someone wants to copy the code from the test program. I would like that person gets the corrected version.
The corrections are:
Jay Chan
Can't find what you're looking for? Ask the community or share your knowledge.