Tuesday, May 1, 2018

Civil 3D Polyline Tools

When I was a kid I recall my dad using the phrase 'a day late and a dollar short' off and on. I know that last week I said I'd be posting these weekly now and given that I'm a day late on this post, hopefully it's still helpful to you.

I tend to do a lot of work with grading and Civil 3D Surface. My workflow in grading has been to utilize all types of Civil 3D grading tools (feature lines, grading groups, corridors, etc) and ultimately paste surfaces together to create a final surface. Often in this work I find myself having to create boundaries for my various surfaces to 'clip' the surface so that it is ready for pasting. With this, you end up working a lot with polylines, thus this post is sort of a collection of polyline tools both native to the software and then some additional 3rd party tools / code that can assist in generating and cleaning up polyline boundaries.

Extracting Polyline Boundaries from Surfaces

For generating boundaries on corridor surfaces, I feel these two commands get overlooked - but are very fast and helpful.

Create Polyline from Corridor
  • Command Syntax: _AeccCreateSubFromPline
 

Create Boundary from Corridor
  • Command Syntax: _AeccCreateBoundaryFromCorridor

General Surface Object Extraction
  • Command Syntax: _AeccSurfaceExtractObjects
I don't have much to say out about the native Surface Object Extraction tool other than it's cumbersome and a bit of pain to use. Make sure whatever you want to extract is turned on in your surface style prior to running the tool (my biggest pet peeve of this native tool). To help with this, I have a free command line tool that allows you to quickly modify a style's object visibility here on the Autodesk App Store.

95% of the time I'm using this for extracting boundaries, thus I'm in the works of a new utility to extract boundaries to be available on the Autodesk App Store soon... more to come on this!



Conversion of 3D Polylines and 2D Polylines

I believe these next three commands are fairly wide known and used within the Civil 3D community, but for sake of those new to the software, I'll list them out; these are routinely used in my workflows.

Convert 2D to 3D Polylines
  • Command Syntax: _AeccConvertPlines
Convert 3D to 2D Polylines
  • Command Syntax: _AeccConvert3dPolys


Flatten Objects

  • Command Syntax: Flatten

This command will help remove elevations from lines, arcs, polylines, 3D Polylines and more in a quick selection of objects.

Determining Issues with Polylines

Perhaps one of the most frustrating and time intensive parts is trying when you are trying to join a polyline and it will not join, or once you have a polyline joined and closed, attempting to add it to a surface and finding the polyline will not add. These issue can typically be resolved by running the three previously mentioned commands, but also checking your polyline for intersections.

Self Intersecting Polylines
How do you check if your polyline has intersections? And if it does, how do I know where the intersections occur? There are no native commands to assist with this that I am aware of.

CAD Studio has a great free LISP utility that can help you find where the intersections of a self intersecting polyline occur here and there's more documentation on it here.

Alternatively, if you have someone that can handle .NET programming, there's some great starter code to do this here. For myself, I've used this code and then added a circle at the intersection points in which I can then find the circles on screen and quickly correct the issue.


Find Polyline End Location
When you are working with a polyline that thousands of vertices and loops back in on itself, it can be beneficial to know where the start/end location is. This will help you to quickly get to that location and make potential edits to resolve the issue. One can do this through the Properties palette as shown below


or, you can do this with a this great little lisp routine shared by the Greg Battin on the AutoCAD Tips Blog that helps to locate gaps in polylines.

Weed Features
  • Command Syntax: _AeccWeedFeatures
  • If you have too many vertices in your extracted boundary from a surface you may want to weed out some of the vertices - beware not to go too far in the weeding however as you could end up clipping off the exact location a surface ties into the existing grade - use your best judgement on this. Here's more on this command
Explode, Flatten, and Rejoin
When in doubt of the issue, don't waste your time trying to figure it out. First change the polyline layer and isolate it, explode at least twice to get it down to basic linework, flatten, and rejoin the polyline.

Linework Commands

These commands tend to be missed I think, but are extremely powerful. I'll list the top three favorites here but there are quite a few. I suggest looking into what all these commands do and how you can leverage them in your workflows.

Linework Shrinkwrap
  • Command Syntax: LINEWORKSHRINKWRAP

Linework Divide
  • Command Syntax: LINEWORKDIVIDE

Linework Trim
  • Command Syntax: LINEWORKTRIM

Many more... just type in LINEWORK and you can see them all listed.

Boundary Area
  • Command Syntax: BPOLY or BOUNDARY
  • This command is more well known, but ultimately allows you to pick inside an area similar to the hatch command and get the boundary as a polyline... just make sure you isolate layers first.

Summary

Overall, when I'm working with on a specific boundary that has a lot of vertices and data to work with, I use a multitude of these commands - but here's my general workflow using Autodesk's Praxis Workflow Editor



1 comment: