AfraLisp Blog

The AutoLisp/Visual Lisp/VBA Resource Website

AfraLisp Blog

Home Newsletter Utter Rubbish Coding Tips AutoCAD Tips Contact Downloads WAUN


A Look at Plan
by Glenn Ryan

Do not think it is used in 3d only. In fact, 99.9% of drawings are still 2d, mine included, and I use the plan command in 2d dwgs, not 3d. It's particularly useful for road layouts.
Imagine you had a road centreline that was going from bottom left of screen to top right. Now when producing road alignment drawings, paperspace generally has a viewport showing the road in plan (just a term, not related to PLAN command at the moment), and another viewport looking at the long section along the road centreline in modelspace. This long section is usually spat out of a design program like Mx.

We'll concern ourselves with just the view of the road not the long section. Now, to use space efficiently in the drawing layout, you would want to show the road going as close to horizontal across your layout (close meaning if it's curved then take best fit), so you could fit the most amount of road metreage in the view. You can accomplish this by using the UCS and PLAN commands. What follows is what I teach in my advanced classes.

All the steps following are in metric by the way, but the principle is still the same. First of all setup a layout with title block and what not. Then cut your main viewport that's going to show the top view of the road like so:

Notice that the coordinate system in the viewport is still WCS as denoted by the icon.

Next thing is to decide what scale you would like to show the road at - a typical scale being 1:500. Now this is where people start to get lost in viewport scales, because what I'm doing here is not only done in mteric but also in METRES. That means paperspace plot scale is in millimetres, but model is drawn at 1 unit = 1 metre. This is common practice in the metric system with civil. In effect my road model is 1000 times smaller that the equivalent millimetres drawing (if a structures person had done it for instance).

If the people in the class are really with it and are advanced, not just attending the class, then I explain the next method, otherwise I just explain UCS and PLAN command for view twisting.

I then put a rectangualr poly over the top of the viewport, then make a block of it with an insertion usually mid left or sometimes mid left but offset towards right. This block is then measured along the centreline poly of the road at the correct scale. So, if the drawing was in millimetres the viewport scale is a straight 1/500xp which is 0.002, but seeing as we're in METRES the scale works out to this 1/ (500/1000) = 1/0.5 = 2xp.

Now that we have that knowledge, we can make our block at 0.5 scale (1:500m), then flip to model and use the measure command with sub command of block, to place the block along the poly like so:


Some of the blocks will need to be manually rotated but that's no big deal. Now, while still in model tab, rotate the UCS about the z axis to match the alignment of the first block:

Now that we have the UCS rotated to where we want it, just issue the PLAN command and hit enter for the default of current, so we end up with the drawing looking like so:

Now what I do is save a view of the desired block. I do this in the view command by defining a window and pick bottom left and top right of the block. Now we flip back to paperspace, jump into our viewport and issue the VIEW command and restore our view to the viewport and voila, the viewport is scaled correctly and rotated like so:

This is the inherent beauty of using views - they preserve they're UCS (if ticked in view dialog), but more importantly their viewtwist angle. Then you just repeat the process for as many blocks and layouts you want in this dwg. Of course I would have road model as xref and have separate dwg file for each plan layout I wanted, but the principle is the same. When you get the hang of it, it's a very fast way to layout a series of dwg's.

A cautionary note: If you ever want to id points in the model (as it would have been surveyed on coord system) make sure to reset your UCS to WORLD before doing so, otherwise coords will be wrong.
if you want to reset your view to WCS plan, just enter UCS then hit enter for default of world. Next use PLAN command and hit enter for default of current ucs (WCS in this case) and you're back to plan view WCS.

The only other command I use in this process is the view sub option of UCS. It will realign your UCS so that XY plane is perp. to viewing direction:

View :

  • Establishes a new coordinate system with the XY plane perpendicular to your viewing direction (parallel to your screen). The UCS origin remains unchanged.

You would typically do this if you had changed to WCS in viewport for some reason, but then wanted to put some text in horizontally - like a note. UCS then V and you're away again.
I hope this has explained the UCS and PLAN commands a bit for you. PLAN generally sets the VIEWTWIST angle.

 
The AutoLisp/Visual Lisp/VBA Resource Website

Copyright 1999-Perpetuity by AfraLisp

All rights reserved.
Information in this document is subject to change without notice.
Site created and maintained by Kenny Ramage

The AutoLisp/Visual Lisp/VBA Resource Website