Civil 3D: Closest Distance Between Two Objects

There are so many useful drafting tools within Civil 3D, many of which could be great additions to “vanilla” AutoCAD. Today’s post will be the first of many helpful tools found in Civil 3D and if possible, I will post LISP routines that provides the same functionality available to AutoCAD.

While working on some road access areas that lead into parking lots, I need to find and measure the closest points between two objects to verify that cars & trucks can fit in the lane.
Shown below is an example of an access point along a roadway. These are not parallel, so I am unable to measure at a nearest spot along a curb and find the distance perpendicular to the other side of the road.

Road Example

The handy tool that is found within Civil 3D is found on the “Analyze” tab and in the “Inquiry” panel’s dropdown list. The tool is named a long one… “Minimum Distance Between Entities”

Ribbon Minimum Distance

The command is MinDistBetweenEntities


Here’s how:

  • The tool is as easy as selecting two objects. After selecting the objects, the results are listed in the command line.
  • You are then asked if you would like a line to be drawn that connects the 2 closest points. I selected Yes because I need to place a dimension at these points.

In the example shown below, the objects selected are Polylines.

Minimum Distance Animated


Minimum Distance Finished

Posted in Civil 3D, Civil 3D Tips, Uncategorized | 1 Comment

Civil 3D 2017: Restore Missing Style Drop-Down Lists

Well, I am currently a (novice) Civil 3D user, and I do a lot of annotating. But I noticed that when I need to change styles for Multileaders and Tables, the drop-down list in the ribbon is missing. The obvious workaround is to use the properties palette. But I am so used to having the drop-down lists in the ribbon.

Luckily there is a system variable to restore these drop-down lists.
By setting the system variable GALLERYVIEW to 0 (zero),

Below quote from the “Help menu”
Controls the type of preview in the ribbon drop-down galleries.
0 (zero) = Displays the list view.
1 = Displays the thumbnail view.

The drawback to turning this off is that you no longer have the new gallery preview functionality. So keep that in mind as you use this variable…

Civil 3D 2017 Mising Dropdowns

Civil 3D 2017 Mising Dropdowns Restored

Posted in Civil 3D, User Interface | Leave a comment

Lisp: Delete Extra Annotative Scales from Objects

This routine has helped me many times when receiving drawings from others that include annotative blocks and text, you may not need as many scales that are applied to these annotative objects.

Everything looks fine with the received file shown below. When I hover over the text and blocks it shows that there are more than one annotation scales applied to them. This is indicated by the two annotative symbols.

Annotative Scale 2

Then you go ahead and select the annotative objects and that’s when these extra annotation scales start their fun.

Annotative Scale 3

Annotative Scale 5

Annotative Scale 4 Even though you can manually delete scales from objects, it is time-consuming and can be prone to miss some objects. That is where this LISP routine comes in handy. provided by Irneb found [here].

When you are in model space, set your scale and then use this routine to purge out all of the scales except the current scale.

::: Delete Annotative Scale Execpt Current
;;; By Irneb

(defun c:ObjectScaleCurOnly (/ ss n scLst OSC:GetScales)
  (print "Select the objects you wish to modify: ")
  (if (or (setq ss (ssget "I")) (setq ss (ssget)))
      ;; Define helper function to get scales attached to an entity
      (defun OSC:GetScales (en / ed xn xd cdn cdd asn asd cn cd sn sd cannoscale)
        (setq ed (entget en))
        (if (and
              ;; Get the XDictionary attached to the object
              (setq xn (vl-position '(102 . "{ACAD_XDICTIONARY") ed))
              (setq xn (cdr (nth (1+ xn) ed)))
              (setq xd (entget xn))
              ;; Get the Context Data Management dictionary attached to the XDictionary
              (setq cdn (vl-position '(3 . "AcDbContextDataManager") xd))
              (setq cdn (cdr (nth (1+ cdn) xd)))
              (setq cdd (entget cdn))
              ;; Get the Annotation Scales dictionary attached to the CD
              (setq asn (vl-position '(3 . "ACDB_ANNOTATIONSCALES") cdd))
              (setq asn (cdr (nth (1+ asn) cdd)))
              (setq asd (entget asn))
              ;; Get the 1st scale attached
              (setq cn (assoc 3 asd))
              (setq cn (member cn asd))
          ;; Step through all scales attached
          (while cn
            (if (and (= (caar cn) 350) ;It it's pointing to a scale record
                     ;; Get the record's data
                     (setq cd (entget (cdar cn)))
                     ;; Get the Context data class
                     (setq sn (assoc 340 cd))
                     (setq sd (entget (cdr sn)))
                     (setq sn (assoc 300 sd))
                     ;; Check if the scale is already in the list
                     (not (vl-position (cdr sn) scLst))
              ;; Add it to the list
              (setq scLst (cons (cdr sn) scLst))
            (setq cn (cdr cn))

      ;; Find a list of scales used in selection
      (setq n (sslength ss))
      (while (>= (setq n (1- n)) 0)
        (OSC:GetScales (ssname ss n))

      ;; Add the current scale to the selection
      (setq cannoscale (getvar "CANNOSCALE"))
      (command "._ObjectScale" ss "" "_Add" cannoscale "")

      ;; Remove all other scales attached
      (command "._ObjectScale" ss "" "_Delete")
      (foreach n scLst
        (if (wcmatch (strcase n) (strcat "~" (strcase cannoscale)))
          (command n)
      (command "")

Posted in AutoLISP, AutoLISP: Text, Modifying | 1 Comment

Import PDF Geometery

New in AutoCAD 2017 is the much-needed ability to import PDFs. This new feature will import geometry and True Type Fonts (.ttf) only. If your PDF file contains fonts that use an .shx font, that text will be imported as linework. But either way, this is by far my favorite new feature.

There are two options to import the PDF:
1) Importing a PDF by browsing to a file.
2) With a PDF already attached to the drawing (like an XREF) – Importing a portion of the PDF or the entire PDF.

Here’s how:

Browsing to a PDF:
The Command to import a PDF is simply PDFIMPORT or the “PDF Import” button is found on the Insert tab > Import panel > Import Dropdown.

PDF Import

Notice the command line that asks you to “Select the PDF Underlay or [File]”. Click on the “File” option.
Select PDF or File

After you select the PDF, You will see the “Import PDF” dialog box.

Import PDF Dialog box

Make sure to check out the options in this dialog box. Something that I really like is that the line weights used in the PDF can be imported. The other great thing is that if the PDF was created using the option to create layers, those layers will be imported as well.

When you click on the “Options…” button of the dialog box, it will open the normal AutoCAD “Options” dialog box. Here you can specify where the PDF Import should place any Images that are in the PDF. These images will be imported and attached to the drawing like an XREF.

PDF Import Options Button

After you click the OK button back in the PDF Import dialog box, the progress bar will churn a little bit and then voila!!! your PDF is now imported as editable AutoCAD geometry.

PDF Import 1 Done

Importing an attached PDF:

You can use the PDFIMPORT command and button just like the above step.
Select PDF or FileThere is also a new button on the “PDF Underlay” Contextual ribbon that displays when you select the PDF that is currently in your drawing.

PDF Underlay Ribbon

When you start the command and select the PDF, you will see the options in the command line to select a portion of the PDF objects or All of the PDF.
Import all or someYou will then need to specify what should be done with the attached PDF after the import is completed.
Unload Detach or KeepThe Settings dialog box looks different but has the same settings as the “Import PDF” considering the PDF is already in your file.

Import PDF Dialog box

When you click OK it will churn away and your PDF will be imported.

Conversion Status

Attached PDF Imported

Posted in New in 2017, PDF, TIPS | 2 Comments

CAD Bloggers at Autodesk University

Once again I have been luck enough to attend Autodesk University. It is always a great time to meet fellow CAD nerds from around the world and especially catch up and meet fellow CAD bloggers. I thought it would be nice to show the bloggers that I have had the chance to catch up with this year. Hopefully some of your favorite bloggers are shown below.
P.S. – notice how many pictures are photo-bombed by R.K.

Lynn Allen
Twitter: @Lynn_Allen
Greg Lynn

Heidi Hewett
(my first AutoCAD Instructor)
Heidi Greg

Shaan Hurley
Twitter: @ShaanHurley
Blog: Hurley

Melanie Stone-Perry & Frank Mayfield

Twitter: @MistresDorkness

Twitter: @TheMadCadr
Frank and Melanie

Greg Battin
Twitter: @AutoCADTips1

Paul Munford
Twitter: @CadSetterOut

Donnie Gladfelter
Twitter: @thecadgeek
The CAD Geek

Kean Walmsley
Twitter: @keanw

R.K. McSwain
Twitter: @cadpanacea
RK McSwain

Kurt Moreno
Twitter: @wkfd

Shaun Bryant
Twitter: @notjustcad
Shaun Bryant

Patrick Hughes
Twitter: @Time_Trvlr
Patrick Hughes

Owen Wengerd
Outside The Box

Christopher Fugitt
Twitter: @C3DReminders
Chris Fugitt

Posted in Autodesk University | 7 Comments

Load A Linetype

Here is a simple explanation for how to load a linetype. I decided to demonstrate how to do so for an appropriate layer but a line type can be loaded from the “Properties” panel as well.

Here’s how:

  • In the Layer Dialog box, under the “Linetype” column, click on the linetype name that is set to your layer. In the example shown, it is set to “Continuous.”
  • A Dialog box “Select Linetype” will appear
  • Click the “Load” button
  • Another dialog box “Load or Reload Linetypes” will display. It is from this long list of linetypes that you need to select the specific linetype.
  • Click OK.
  • The linetype is loaded but it isn’t assign to the layer.
  • So now that you are back in the “Select Linetype” dialog box, select the newly loaded linetype and then click OK.
  • The linetype is now loaded in the drawing and assigned to a layer

Load Linetype for Layer

The loaded linetype can also be seen in the Properties palette and in the Properties panel of the ribbon on the Home tab of the ribbon.

Linetype in the Properties Panel 1

Linetype in the Properties Panel 2

Posted in Layers, Linetypes | 2 Comments

Revit Reorganize Revit Tabs

As I have been making my transition to Revit I have a few tips that you might find helpful even though there are plenty of other Revit blogs and resources to visit – I promise to keep this blog as AutoCAD-focused as possible but keep in mind that I am making the transition to Revit but my heart is truly in AutoCAD and these tips are for when you, as an AutoCAD user find yourself in the “World of Revit” and need some help.

I currently work for a structural engineering firm in Denver using Revit and occasional use AutoCAD. When I open Revit 2014 and newer, the various Revit “flavors” are all in one package. This package used to be called “Revit One Box” but that name faded away and it is simply called “Revit”.

When you open Revit in its default “out-of-the-box” settings the first panel of the ribbon is the Architectural tab – which is just fine if you are and Arch person. But for others like us Structural or MEP folks, it would be nice to be able to open Revit and have it open to the discipline in which we work. Thus the tips for today.

Simply Hold the CTRL button down and then drag the Ribbon tab to the front of the ribbon so that it opens when you open Revit. This also allows you to reorganize the other ribbon tabs that you have. Just be aware if your have many ad-ons, this could be messy, but worth it.

Structure Tab 1st baby

And to be honest, the lack of controls in Revit make me miss AutoCAD that much more everyday – like the CUI and customization… But Revit has its strengths in just doing what it does without having to need extra add-ons as much…


Posted in Customization, Revit | 7 Comments