Search Posts

Listing a 2D distance in Civil 3D

Using the DIST command in Civil 3D (2010 SP1 for this example) returns a slope distance when you select a 3D object.  Using just AutoCAD you execute the DIST command and get a 3d distance.  Using Civil 3D the command on the Inquiry toolbar is MEASUREGEOM.  This also produces 3D distances.  I want the 2D distance.  

This is how I list a 2D distance using a .XY filter.

The goal of the .XY filter is to produce delta Z = 0.  You can get this by having the first and second pick points at the same elevation.  The example below shows how to get the 2D distance with the fewest clicks.

Start the DIST command
Type .XY <hit enter>
Pick the first point
Your are prompted for Z value
Pick the second point to get it’s Z value
Next, you are prompted for Second Point
Pick the second point without any filter to get x,y,z
Since the z values are the same for the first and second point you get the 2D distance

You can get this process minimized to 4 clicks by using a macro.  I made a macro and added it to the inquiry toolbar as a new button.  Below is the macro string. (Note there is no space after the last semicolon.)

'_dist;.xy;

Below are a few concerns.  Things that should have worked but did not. The examples use the coordinates listed below.

Command: id Specify point:  X = 5377.0002     Y = 5191.0019     Z = 250.8480
Command:  ID Specify point:  X = 5527.0019     Y = 5191.0031     Z = 253.8480

1. OSNAPZ=1 should return zero for Z at each endpoint I select (AutoCAD sytem variable ELEV=0).  It does not for the DIST command nor the MEASUREGEOM command.

In this example I picked 2 points, one at elev 250.85 and the other at 253.85.  This should produce a Delta Z of 3

Command:  DIST
Specify first point:
Specify second point or [Multiple points]:
Distance = 294.8548,  Angle in XY Plane = 0,  Angle from XY Plane = 59
Delta X = 150.0017,  Delta Y = 0.0012,   Delta Z = 253.8480

This result using OSNAPZ=1 is clearly out to lunch for these two commands.  However, drawing a line with this setting will produce the correct result.

2. Using .XY for the both picks of the DIST command and answering the prompt for Z by typing 0 each time should have produced a zero for Delta Z.  This technique produced an extremely incorrect result when I snapped to the node of a Civil 3D Point Object or the Endpoint of a Parcel Segment. 

 Command: di DIST
Specify first point: .xy of (need Z): 0

Specify second point or [Multiple points]: .xy of (need Z): 0

Distance = 7473.8632,  Angle in XY Plane = 224,  Angle from XY Plane = 0
Delta X = -5377.0002,  Delta Y = -5191.0019,   Delta Z = 0.0000

This example is not even close to the true answer.  Luckily we have a technique that works and even takes fewer keystrokes when built into a simple macro in a toolbar.