Zoom Extends
OK, I am on Mac.
But for me it looks like Zoom Extends also zooms to Geometry which Layers are switched
OFF/Invisible. To avoid that, I additionally need to Freeze these Layers.
Does it make sense to "Zoom Extends" to Objects currently being invisible !?
And if so, because this is Autocad Compatibility ?
... so I vote for an additional Zoom Option.
(If something selected - Zoom to Selection/if nothing selected - Zoom to everything visible)
Comments
-
It works the same way in Windows. And yes, probably for compatibility.
Select All (Ctrl-A in Windows) includes objects in layers that are off, so you can't do it with Zoom OBjects. But I think the new command you want can be created pretty easily using Lisp:
- If anything is selected when you issue the custom command, the Lisp function would just perform a Zoom Objects command.
- If nothing is selected, it would first do a Zoom All command. Then it would get the coordinates of two opposite corners of the screen, and then create a selection set by window or crossing (using those corners as the pick points), and then do a Zoom Objects command.
0 -
@Michael Mayer said:
...
... so I vote for an additional Zoom Option.
(If something selected - Zoom to Selection/if nothing selected - Zoom to everything visible)Here's a custom command that does that. It may not be quite what you expected. If I remember correctly, VectorWorks commands always operate on pre-selected objects. But in .dwg world, you can pre-select or select later.
So if something is pre-selected, this command zooms to it. But if nothing is pre-selected, it doesn't take that to mean you want to zoom to everything visible. It just assumes you want to post-select, as usual when there's no pre-selection. So then you can either select the object(s) to zoom to, and then hit Enter or Space, or else just hit Enter or Space to select nothing and zoom to everything.
I don't know of any way to limit it to pre-selection. If I did, I'd assign this command to my Home key, in place of the Zoom All command. In fact, I might do that anyway, just because it doesn't include invisible objects in the everything it zooms to.
It's slow when zooming to everything visible. I don't know a quicker way to get the coordinates for the Crossing, though I'm sure there must be one.
And for some reason the forum is not putting my code in a box or letting me format it in any other way, so I'll also attach it as a Lisp file.
|||||||||||||||||||||||||||||||||||||||||||||||||
(defun c:ZS ( / ss0 ss1 p1 p2 vCtr vSize sSize vLength)
;zoom to selection set, or to everything visible if no selection set(setq ss0 (ssget))
(if ss0 (progn
(sssetfirst nil ss0)
(command "zoom" "ob")
) ;close first progn(progn ; if no ss0
(sssetfirst nil nil)
(command "zoom" "all")(setq vCtr (getvar "viewctr"))
(setq vSize (getvar "viewsize"))
(setq sSize (getvar "screensize"))
(setq vLength (* vSize (/ (car sSize) (cadr sSize))))(setq p1 (list (- (car vCtr) (/ vLength 2)) (+ (cadr vCtr) (/ vSize 2))))
(setq p2 (list (+ (car vCtr) (/ vLength 2)) (- (cadr vCtr) (/ vSize 2))))(setq ss1 (ssget "C" p1 p2)) (sssetfirst nil ss1)
(command "zoom" "ob")
) ;close second progn
) ;close if
) ;close defun0 -
@Michael Mayer said:
...
... so I vote for an additional Zoom Option.
(If something selected - Zoom to Selection/if nothing selected - Zoom to everything visible)Here's a custom command that does that. It may not be quite what you expected. If I remember correctly, VectorWorks commands always operate on pre-selected objects. But in .dwg world, you can pre-select or select later.
So if something is pre-selected, this command zooms to it. But if nothing is pre-selected, it doesn't take that to mean you want to zoom to everything visible. It just assumes you want to post-select, as usual when there's no pre-selection. So then you can either select the object(s) to zoom to, and then hit Enter or Space, or else just hit Enter or Space to select nothing and zoom to everything.
I don't know of any way to limit it to pre-selection. If I did, I'd assign this command to my Home key, in place of the Zoom All command. In fact, I might do that anyway, just because it doesn't include invisible objects in the everything it zooms to.
It's slow when zooming to everything visible. I don't know a quicker way to get the coordinates for the Crossing, though I'm sure there must be one.
And for some reason the forum is not putting my code in a box or letting me format it in any other way. I tried to attach a Lisp file, but it won't let me do that either. It said "You are not allowed to upload files in this category."
|||||||||||||||||||||||||||||||||||||||||||||||||
(defun c:ZS ( / ss0 ss1 p1 p2 vCtr vSize sSize vLength)
;zoom to selection set, or to everything visible if no selection set(setq ss0 (ssget))
(if ss0 (progn
(sssetfirst nil ss0)
(command "zoom" "ob")
) ;close first progn(progn ; if no ss0
(sssetfirst nil nil)
(command "zoom" "all")(setq vCtr (getvar "viewctr"))
(setq vSize (getvar "viewsize"))
(setq sSize (getvar "screensize"))
(setq vLength (* vSize (/ (car sSize) (cadr sSize))))(setq p1 (list (- (car vCtr) (/ vLength 2)) (+ (cadr vCtr) (/ vSize 2))))
(setq p2 (list (+ (car vCtr) (/ vLength 2)) (- (cadr vCtr) (/ vSize 2))))(setq ss1 (ssget "C" p1 p2)) (sssetfirst nil ss1)
(command "zoom" "ob")
) ;close second progn
) ;close if
) ;close defun0 -
More forum issues: It posted my comment twice, once when I tried unsuccessfully to include an attachment and thought it hadn't posted, and again later when I tried it without the attachment. And now it won't let me edit either post.
0 -
You can try this, assuming the site will let me attach a file. Based on code by Lee Mac. Tested in model space but not in paper space.
0 -
You can try this. The site will not let me attach the file so the formatting will be mangled. Based on code by Lee Mac. Tested in model space but not in paper space.
(defun c:zv ( / layer_list selset temp )
(while (setq temp (tblnext "layer" (not temp)))
(if (or (< 0 (logand 1 (cdr (assoc 70 temp))))
(< 0 (logand 5 (cdr (assoc 70 temp))))
(minusp (cdr (assoc 62 temp)))
)
(setq layer_list (cons (cons 8 (LM:escapewildcards (cdr (assoc 2 temp)))) layer_list))
)
)
(setq selset (ssget "X" (cons
(if (= 1 (getvar 'cvport))
(cons 410 (LM:escapewildcards (getvar 'ctab)))
'(410 . "Model")
)
(if layer_list
(append '((-4 . "<NOT") (-4 . "<OR")) layer_list '((-4 . "OR>") (-4 . "NOT>")))
)
)
)
)
(setq min_x 1e99
min_y 1e99
max_x 1e-99
max_y 1e-99
)
(setq selset (vle-selectionset->list selset))
(foreach memb selset
(setq points (acet-ent-geomextents memb))
(if (and (/= (car (car points)) nil)
(< (car (car points)) min_x)
)
(setq min_x (car (car points)))
)
(if (and (/= (cadr (car points)) nil)
(< (cadr (car points)) min_y)
)
(setq min_y (cadr (car points)))
)
(if (and (/= (car (cadr points)) nil)
(> (car (cadr points)) max_x)
)
(setq max_x (car (cadr points)))
)
(if (and (/= (cadr (cadr points)) nil)
(> (cadr (cadr points)) max_y)
)
(setq max_y (cadr (cadr points)))
)
)
(command ".zoom" "_W" "_non" (list min_x min_y) "_non" (list max_x max_y))
(princ)
);; Escape Wildcards - Lee Mac
;; Escapes wildcard special characters in a supplied string(defun LM:escapewildcards ( str )
(vl-list->string
(apply 'append
(mapcar
'(lambda ( c )
(if (member c '(35 64 46 42 63 126 91 93 45 44))
(list 96 c)
(list c)
)
)
(vl-string->list str)
)
)
)
)(princ)
0 -
You can try this. The site will not let me attach the file so the formatting will be mangled. Based on code by Lee Mac. Tested in model space but not in paper space.
(defun c:zv ( / layer_list selset temp )
(while (setq temp (tblnext "layer" (not temp)))
(if (or (< 0 (logand 1 (cdr (assoc 70 temp))))
(< 0 (logand 5 (cdr (assoc 70 temp))))
(minusp (cdr (assoc 62 temp)))
)
(setq layer_list (cons (cons 8 (LM:escapewildcards (cdr (assoc 2 temp)))) layer_list))
)
)
(setq selset (ssget "X" (cons
(if (= 1 (getvar 'cvport))
(cons 410 (LM:escapewildcards (getvar 'ctab)))
'(410 . "Model")
)
(if layer_list
(append '((-4 . "<NOT") (-4 . "<OR")) layer_list '((-4 . "OR>") (-4 . "NOT>")))
)
)
)
)
(setq min_x 1e99
min_y 1e99
max_x 1e-99
max_y 1e-99
)
(setq selset (vle-selectionset->list selset))
(foreach memb selset
(setq points (acet-ent-geomextents memb))
(if (and (/= (car (car points)) nil)
(< (car (car points)) min_x)
)
(setq min_x (car (car points)))
)
(if (and (/= (cadr (car points)) nil)
(< (cadr (car points)) min_y)
)
(setq min_y (cadr (car points)))
)
(if (and (/= (car (cadr points)) nil)
(> (car (cadr points)) max_x)
)
(setq max_x (car (cadr points)))
)
(if (and (/= (cadr (cadr points)) nil)
(> (cadr (cadr points)) max_y)
)
(setq max_y (cadr (cadr points)))
)
)
(command ".zoom" "_W" "_non" (list min_x min_y) "_non" (list max_x max_y))
(princ)
);; Escape Wildcards - Lee Mac
;; Escapes wildcard special characters in a supplied string(defun LM:escapewildcards ( str )
(vl-list->string
(apply 'append
(mapcar
'(lambda ( c )
(if (member c '(35 64 46 42 63 126 91 93 45 44))
(list 96 c)
(list c)
)
)
(vl-string->list str)
)
)
)
)(princ)
0 -
Bricsys really needs to fix these forums so code can be posted. There should be a way to post code without having the formatting mangled. There is no update of the thread when there is a pop-up saying you can't attach files but the response does get posted, which causes multiple posts. None of these are a good look for a software company.
0 -
@H Martin Shoemaker
Note that BricsCAD has avle-getgeomextents
function which will accept a selectionset as input.0 -
Sorry for the delay, had unexpected deadlines .....
Thanks all.
Those code bits are far from my imagination0 -
@Anthony Apostolaros said:
I don't know of any way to limit it to pre-selection.
and
@Roy Klein Gebbinck said:
Note that BricsCAD has a vle-getgeomextents function which will accept a selectionset as input.
I also think it is basically already there.
As you can Zoom to one or more special Objects from right click option menu
in Structure Browser.
(Which may be a bit different than zooming to a Selection)
Similar to Twinmotion, which AFAIK hasn't even any other Option/Tool to zoom
extents or zoom to selection. Just by RMB click only in their "Structure Browser"Cinema4D has too Tools, Zoom to all Geometry vs Zoom to Selection.
Modo has "A" to zoom to all + SHIFT+"A" to zoom to SelectionVectorworks and AFAIK Microstation automatically zoom to all, if nothing
selected or to Selection, if something selected - by a single Tool (?)This is basically a Feature Request only which I already SR'ed
(Like being able to use NumBlock, similar to Bricscad View Gizmo, to orient 3D View,
while no Commands are active. E.g. "2" is front view, "8" is back, "1" is left front Iso, ....)But my main point here is still :
Does it make sense to "Zoom Extends" including Objects currently being invisible !?
0 -
I tried both acet-geom-ss-extents and vle-getgeomextents but was getting nil values in the lower left point for the test drawing I was using. This was before I added code to eliminate frozen layers. Since I had already written the manual equivalent to vle-getgeomextents and the manual version was fast enough I did not go back and re-try the built-in functions.
0 -
@Michael Mayer said:
I also think it is basically already there.There is a specific issue related to layers that are OFF. Inserts of blocks on those layers will display their content, if that content is on a layer that is ON and THAWED.
Why don't you just FREEZE layers instead?
0 -
Martin: Your custom command worked fine for me both in paperspace and in modelspace, and it zoomed to everything visible much faster than the method I used. I wish I understood how it works. It always zoomed to everything visible, regardless of whether there was a pre-selected selection set.
Michael: I've posted the lisp file for my ZS command here on Google Drive. You can download it without a password or sign-in. Just save it in a location that's easy to find. Then:
- in Bricscad, pull down Tools > Load Application
- click on the "Load application file" icon
- browse to ZS.lsp and select it
- check the "Autoload" box on the ZS.lsp line which then appears in the Load Application palette.
After that, any time you enter ZS you'll get the zoom described.
0 -
First of all. STOP USING ON/OFF it is useless and dangerous.
FREEZE / THAW works as it should.
on/off also allows you to pick and move invisible ( off ) objects.0 -
@Patrik Sparrman said:
First of all. STOP USING ON/OFF it is useless and dangerous.I use on/off constantly, and have done so for many years. I find it extremely useful and completely safe. FF turns off the layer of a selected object, F9 makes the layer of a selected object active, F10 turns off all layers except the active layer, and NN turns on all layers and makes Defpoints the active layer. I freeze any layers that I don't want turned on by NN.
0 -
@Roy Klein Gebbinck said:
There is a specific issue related to layers that are OFF. Inserts of blocks on those layers will display their content, if that content is on a layer that is ON and THAWED.
OMG.
Why don't you just FREEZE layers instead?
I think because I simply do not get the whole Autocad Layer System.
Pre my first Auto desk experiences via Bricscad,
in Microstation, Nemetschek Allplan, Sketchup, Vectorworks, ...
in never felt any need to ever even think or care about Layer
Systems.0 -
@Patrik Sparrman said:
First of all. STOP USING ON/OFF it is useless and dangerous.
FREEZE / THAW works as it should.
on/off also allows you to pick and move invisible ( off ) objects.It looks to me like this makes sense.
But I just opened to see what Bricscad Shape does and expected
Freeze Icons only .... but it uses ON/OFF instead !?I used ON/OFF after as I was told that the only difference is, that Freeze
will unload the Geometry from GPU and takes longer to Thaw again.
(But AFAIK that is basically the default behavior in the other world's
CAD Apps and GPUs fast enough nowadays)But it looks like there is much more to it.
Freeze seems the only reliable way to save/hide any invisible Geometry
from getting accidentally selected or manipulated.
(Not sure if things like CTRL+A will also let them in peace)I do not even get at all why even "locking" Layers will not save their Objects
from being accidentally highlighted or being selected.
At least they seem to be reliably locked and save from manipulations (!?),
by throwing a Warning message though.0 -
@Anthony Apostolaros said:
FF turns off the layer of a selected object, F9 makes the layer of a selected object active, F10 turns off all layers except the active layer, and NN turns on all layers and makes Defpoints the active layer. I freeze any layers that I don't want turned on by NN.That F10 would be great - if there was a simple and fast way to just bring back the
previous Layer visibility state.Microstation had at least a "layer Lock" switch that let you select on active Layer only.
So you could select all to examine what is on that Layer or to be sure to select and
manipulate objects on this layer only.
Vectorworks has overall/parent Layer Settings, like "Active only", which will do basically
a F10, but temporary if needed because not because it does not manipulate the
individual Layer settings and going to another parent Layer setting would get you
back to previous Layer states.In Bricscad I would basically need to save a "Layer State" to get back from F10
(= isolate Layer ?) to - at least to a similar - Layer visibility as before isolating.0 -
I really do not get in general, why it makes any sense to allow invisible
objects to get effected by any selection or manipulation at all.
(Or a ZOOMe in this case)Does this mean any loss of features for Autocad users, if someone would
take that strange behavior away ?0 -
The original code is at https://www.cadtutor.net/forum/topic/66829-select-all-entities-in-working-space/
Lee's comment was, "Rather than applying a 'positive' layer filter which includes all layers which are turned on, thawed, and unlocked in a drawing (which is likely to comprise of many layers), I would instead suggest applying a 'negative' layer filter to exclude those layers which are turned off, frozen, or locked (which is likely to comprise of fewer layers)."
0 -
@Michael Mayer said:
Microstation had at least a "layer Lock" switch that let you select on active Layer only.I have a custom command that does something like that. I enter QLL, and anything not on the active layer is removed from the selection set.
If I enter QL and specify a layer, everything not on that layer is removed from the selection set. I use both of those a lot, and several other Q filters.
I work with PICKADD off, so selecting anything de-selects everything else. With my layer commands and Q filters, I rarely have to use anything other than a single window or crossing to get the selection set I want.
Much of the time I don't have to do any selection. All the commands I use are custom commands that leave any newly created objects selected, and if no new objects were created they leave the previous set still selected.0 -
Yes, I remember ....
All the commands I use are custom commands
I am also a PICKADD OFF user and drag my marquees.
0