Zoom Limits per layer

Zoom Limits per layer

sbozzolii
Participant Participant
2,096 Views
13 Replies
Message 1 of 14

Zoom Limits per layer

sbozzolii
Participant
Participant

Hello,

 

My question is, does anyone know if it is possible to set limits of a zoom distance per layer.  So if layer 1 is on and I zoom closer layer 2 then appears, and then closer layer 3 appears and so on. As I zoom out 3 turns off then 2 at certain distances.

 

Is this possible in AutoCAD?  This is a function that is widely used in ESRI and my boss would really like me to be able to produce this function in AutoCAD.

 

Thank you,

Scott Bozzoli

0 Likes
2,097 Views
13 Replies
Replies (13)
Message 2 of 14

imadHabash
Mentor
Mentor

Hi,

 

as you describe your issue there is NO way to that in AutoCAD.

Imad Habash

EESignature

0 Likes
Message 3 of 14

sbozzolii
Participant
Participant
Thank you. I knew there wasn't, but needed reassurance that I hadn't missed any new updates. Do you know if this may become possible in the future?



Scott


0 Likes
Message 4 of 14

imadHabash
Mentor
Mentor

>> Do you know if this may become possible in the future? <<

nobody can tell .... let's wait and see 🙂

Imad Habash

EESignature

0 Likes
Message 5 of 14

john.vellek
Alumni
Alumni

HI @sbozzolii,

 

I haven't seen this feature request before and it is not possible in plain AutoCAD. With that said however, I imagine a routine could be created that when a layer is made current, a reactor could cause a zoom by a percentage or to a predefined area.

 

I will move this thread to the customization forum so the Community might offer more suggestions or solutions.

 

 

Please select the Accept as Solution button if my post solves your issue or answers your question.


John Vellek


Join the Autodesk Customer Council - Interact with developers, provide feedback on current and future software releases, and beta test the latest software!

Autodesk Knowledge Network | Autodesk Account | Product Feedback
0 Likes
Message 6 of 14

Shneuph
Collaborator
Collaborator

Perhaps you could make a :VLR-SysVar-Reactor to look at the viewsize variable and freeze/thaw layers based on that value.  Don't have time to remember reactors and do this now.. but one of the lisp gurus could probably whip something like this it out for you.

---sig---------------------------------------
'(83 104 110 101 117 112 104 64 71 109 97 105 108 46 99 111 109)
0 Likes
Message 7 of 14

steve_carson
Enthusiast
Enthusiast

There is a feature similar to this in Civil3D called "LevelOfDetail". It doesn't do it by layer though.

0 Likes
Message 8 of 14

Kent1Cooper
Consultant
Consultant

@sbozzolii wrote:

.... does anyone know if it is possible to set limits of a zoom distance per layer.  So if layer 1 is on and I zoom closer layer 2 then appears, and then closer layer 3 appears and so on. As I zoom out 3 turns off then 2 at certain distances.

 

....

That may be possible, but questions arise.  Would you want it to always do that when you Zoom in or out?  Something like a reactor looking at the VIEWSIZE System Variable would presumably have to work that way.  Or might you sometimes want to Zoom in without turning Layers on, or out without turning them off?  I could pretty easily imagine a couple of menu buttons or command definitions that would be for Zooming in and out with this Layer-control enhancement, but you would still be left with the possibility of using regular Zoom without any effect on Layer settings, when you want to.

Kent Cooper, AIA
0 Likes
Message 9 of 14

Kent1Cooper
Consultant
Consultant

@Kent1Cooper wrote:
....  I could pretty easily imagine a couple of menu buttons or command definitions that would be for Zooming in and out with this Layer-control enhancement, but you would still be left with the possibility of using regular Zoom without any effect on Layer settings, when you want to.

A very rough framework for such a pair of commands:

 

(defun C:ZIL (); = Zoom In with Layer effect
  (command
    "_.zoom" "11/10x"
    "_.layer" "_on"
      (cond
        ((< (getvar 'viewsize) 3) "2,3,4")
        ((< (getvar 'viewsize) 5) "2,3")
        ((< (getvar 'viewsize) 7) "2")
        (""); nothing if none of the above
      ); cond
      "" ; end Layer
  ); command
  (princ)
); defun

(defun C:ZOL (); = Zoom Out with Layer effect
  (command
    "_.zoom" "10/11x"
    "_.layer" "_off"
      (cond
        ((>= (getvar 'viewsize) 7) "2,3,4")
        ((>= (getvar 'viewsize) 5) "3,4")
        ((>= (getvar 'viewsize) 3) "4")
        ("")
      ); cond
      ""
  ); command
  (princ)
); defun

Set up a drawing using AutoCAD's default template for a 12x9 drawing area, so the VIEWSIZE System Variable value is initially 9.  Make Layers 1 through 4 and draw some things in each, and turn off 2, 3 & 4 -- 1 is the Layer that would stay on at Zoomed-out level.  As you use ZIL successively to Zoom in, when the Zoom level passes the 7-unit VIEWSIZE, Layer 2 is turned on; when it passes 5, 3 is turned on also; etc.  [I included the multiple Layer names in case you might start at some other-than-9 VIEWSIZE value -- by whatever means and whatever starting point you are coming from, when you get in to the last stage, it turns all three Layers on, not just the "innermost" one, otherwise you could get some peculiar combinations.]  Then ZOL-ing back out, the Layers are turned back off in reverse order as the thresholds are passed.

 

They work only in Zooming in/out by scale factor, about the center of view, not with Window, etc., and the Layer changes happen only when using these commands, not in [for example] mouse-wheel Zooming.  So you can Zoom however you like without affecting Layer settings when you want to, by using the mouse wheel or the regular Zoom command.

 

You would have to play around with the percentage of Zooming in/out [I made them reciprocal and used fractions so they'd be exactly reciprocal, so if you use some ZIL's and then the same number of ZOL's, it takes you back to the same Zoom level], and the threshold values of VIEWSIZE at which changes are made, and of course the Layer names, and how many Layers you want affected, and so on.  With appropriate Drawing Limits, it could be made to judge proportionally to them for any size drawing, rather than being purpose-built for a specific drawing size as these are.

 

Not the ultimate solution yet, but at least it demonstrates an approach.

Kent Cooper, AIA
0 Likes
Message 10 of 14

sbozzolii
Participant
Participant
Thank you. So far this has been the best advice. I will try this tomorrow when I get back in the office. I wonder if this can someday be a quick AutoCAD command
0 Likes
Message 11 of 14

john.uhden
Mentor
Mentor

Does this have anything to do with the difference in extents between objects on layers 1, 2, 3, etc?  Or are objects on those layers relatively equally spread out over model space?  Maybe you need to assign a zoom level per layer if there is empirical evidence to support such a theory.  I am trying to figure out if there is some heirarchy (sp?) that we can harness to help you in AutoCAD.  Most of us here find great fun in creating a little magic.  You could return the favor by teaching us how to make bills disappear, or how to pick winning lottery numbers, the latter being preferred.

John F. Uhden

0 Likes
Message 12 of 14

Kent1Cooper
Consultant
Consultant

@john.uhden wrote:

.... Maybe you need to assign a zoom level per layer if there is empirical evidence to support such a theory.  I am trying to figure out if there is some heirarchy (sp?) that we can harness to help you in AutoCAD.  ....


I'm imagining they're talking about a situation similar to this Architectural example, and what I imagine that LevelOfDetail feature in Civil3D [mentioned by @steve_carson in Post 7] must be like:  Layer 1 has the outermost face lines of walls, Layer 2 has the stud lines inside (the back side of the drywall), Layer 3 has insulation batting squiggles, Layer 4 has the actual studs themselves.  So when Zoomed out far enough, all you see are the outermost wall-face lines, because the detail of the rest of it would be lost at too small a viewing scale.  When you Zoom in a little closer, you see the thickness of the drywall, go in further and you see the insulation indication, go way in and you see the individual studs.  Back out and successively the various levels of too-much-detail go away again.  @sbozzolii, is that a reasonable analogy?

Kent Cooper, AIA
0 Likes
Message 13 of 14

john.uhden
Mentor
Mentor

That seems like a very good analogy to me, though I am no architect.  I guess what I was thinking of was tying a zoom level to a layer state, then using a reactor to read an xrecord or xdata to perform the zoom.  Wait, maybe I have it backwards... if he zooms in, then more layers are thawed and vice versa.  That would be fired by viewsize, as you pointed out, and there would have to be a relationship between a viewsize and a layer state.  That could cause a lot of regens for someone like myself who uses the mouse wheel a lot.  But I guess it would still be quite a benefit to the OP compared to manually recalling any number of layer states.  I am presuming that such interaction would be confined to model space only (tilemode = 1).  He could then use my tilemode reactor when switching to any other layout tab where vplayer would control visibility.

John F. Uhden

0 Likes
Message 14 of 14

stevor
Collaborator
Collaborator

Aslo have seen it in other CADs.

As much as I dislike reactors,

your approach will eventually occur,

then be incorporated into the core.

 

And yet another parameter for layer  'limits'

could be the extents, or bounding box

of the entities on each layer.

Yet what I saw may have been simply

features assigned to each entity; or

by the actual function doing the zooming, like Kent's.

 

Either way, viewsize changed what type was seen.

 

S
0 Likes