Thursday, October 23, 2008

Quickies - Commands That May Come In Handy

Today I thought I'd list out some commands that may be helpful to you while working with 2009 AutoCAD products.


In Civil 3D, you have the ability to assign a coordinate system to the drawing. When you do this in 2009 a glyph will appear on screen, this is the geomarker.


From the help file....

The geographic marker is a visual representation of the location information and is created at the specified point on the drawing.


So, to disable this marker, use the GEOMARKERVISIBILITY command. A setting of 0 will turn the marker visibility off.


Also in Civil 3D - Use the SHOWDRAWINGTIPS command to display marker lines along your alignment and profile. When hovering an alignment, a reference line will show up on the profile and visa-versa. If you get sick of em', use the HIDEDRAWINGTIPS command.


In general AutoCAD (and any AutoCAD based application), I have a few commands that you may find useful.


LAYERDLGMODE: Setting this variable to 0 will cause the Layer Manager Palette to return to pre-2009 form, a dialog box.


MENUBAR: Setting this variable to 0 will turn off your menubar. In 2009, the Menu Browser contains all of your menus, so if you'd like to save some real-estate, turn off the menu bar and start training yourself to use the menu browser!


MEASUREINIT: This variable tells AutoCAD to use Imperial units, meaning Imperial hatch patterns and linetypes or Metric. A setting of 0 tells AutoCAD to use Imperial, 1 is Metric.


BROWSER: Type this command and press enter twice to go to the Autodesk website with your default web browser, type the command and press enter once, then you can enter your own web address into the command line and press enter. Your default web browser will open to the page you enter.



Monday, October 6, 2008

Starting Hydraflow within Civil 3D

By default you have to double-click the hydraflow application you wish to start via a shortcut - usually on the desktop. For some, this is very acceptable, either they don't use Civil 3D and only use Hydraflow, or they use Civil 3D and don't care about Hydraflow.

If you're in the middle and your inside of Civil 3D wanting to open Hydraflow, you have to minimize Civil 3D before launching Hydraflow. I'll offer a quick tip to fix that, here is how I'm opening Hydraflow within Civil 3D.

First, there is no command for Hydraflow, let alone seperate commands for each extension. Knowing AutoCAD, we know that in order to do anything, a command is needed to execute the action you want to take. As mentioned, Civil 3D has nothing in the way of Hydraflow commands, so we're starting from the ground. A little (little should be stressed here) programming is in order to define the commands needed to launch Hydraflow within Civil 3D.

If you're not LISP savvy, and I'm not, you can search around online to find resources to help you along, a great resource for everything lisp and CAD Management is Robert Green's site http://www.cad-manager.com/ . Check it out when you can, for now I'll copy my code here so you can just paste it into a notepad file and get moving.

Once we tell Civil 3D (via lisp) to define our new commands, we can create commands in the CUI that reference our lisp commands.

The lisp code I used for Storm Sewers is as follows:

(defun c:hstm ()
(startapp "\"C:\\Program Files\\Hydraflow Storm Sewers Extension for AutoCAD Civil 3D 2009\\Storm2009.exe\"")
(princ)
)

Line by line definitions:

Line 1: Defun = Define Function, we're defining a command, that command is HSTM, that is what I called it, you can call it whatever you want.

Line 2 & 3: AutoCAD already has a command called startapp for Start Application, use this to navigate to the .exe file you want to run.

Line 4 & 5: Needed to to close the lisp. You'll always see the (princ) at the end of a lisp. I don't know why, it's just always there! If you know, leave a comment and fill me in!

I followed this format with each extension, giving me three new commands. Here are the other lisp files:

Hydrographs:

(defun c:hydro ()
(startapp "\"C:\\Program Files\\Hydraflow Hydrographs Extension for AutoCAD Civil 3D 2009\\Hydro2007.exe\"")
(princ)
)

Express:

(defun c:hexp ()
(startapp "\"C:\\Program Files\\Hydraflow Express Extension for AutoCAD Civil 3D 2009\\HydraflowExpress.exe\"")
(princ)
)

Once those are created and loaded (I just loaded them into my Startup suite, so each drawing that opens loads them) you have a choice. You can run the commands as they are, limiting you to entering the commands at the command line, or you can make buttons out of them and add them to a menu. I've added mine to a Hydro menu I created. Since the command list won't show the newly created commands, you'll have to add them.


I've pasted the contents of the storm sewers command above. From that, hopefully you can figure the other two out. Once there is a command is there, you can add it to a toolbar or menu or even a ribbon panel.







AutoCAD Tools in Civil 3D


So many of us are used to AutoCAD. Sometimes, we're so familiar with AutoCAD that finding commands and utilities can be difficult unless those AutoCAD menus are present.

It's not too difficult to turn AutoCAD menus on in Civil 3D, but if you turn all of AutoCAD on, still have all of Civil 3D turned on, then maybe toss in Raster Design or Trimble Link your menu bar is two lines, taking up more space!!!

What I'm proposing - consolodate. You don't need to have those AutoCAD menus showing all the time, you just need them to be available when you DO need them - so....

Create a new menu in the Civil 3D CUI and copy/paste the AutoCAD menus into it.

What do you think?