CADalyzer 0.6b Update (AutoCAD Command Counter)

This is an update to the Cadalyzer script that I posted a few months ago. It will count the number of commands you have used in AutoCAD; it does this by examining your AutoCAD log files. (You can enable log files in AutoCAD’s options dialogue box.)

Cadalyzer 0.6b download
New features are listed below
  • Counting mechanism has be rebuilt, the script now computes 25 times faster than the previous version!
  • shows the total number of commands used (Apparently I’ve invoked approx. 38,000 commands since this previous October. Ouch.)
  • several command line options have been implemented:
    • unused - shows all the commands you didn’t use; this is helpful when you want to learn more commands
    • compile - compiles all of the logs in the directory and saves them to a single file
    • results - saves the results to a file
    • percent - formats the each command as a percentage of the total commands used

You will need Ruby installed (tested on 1.8.6 and up.) You can find the Ruby download here. If you don’t use Ruby but would like to learn to program, I highly recommend it. Ruby is an excellent language for beginners and advanced alike.

The only other thing you will need is to tell the script where to find your log file directory. Open the Cadalyzer.rb file and look for the line path = '/Path/to/log/files/” Replace the /Path/to/log/files/ with your path and run the script.

Happy analyzing!

Dykes Mouldling - CAD Files

If you’ve downloaded the Dykes Moulding CAD files from their website you may have noticed that the profiles are not to scale. From what I could see, the scale factor seems to be the same for all the files, approximately 0.056568174 (find the humor in that.)

CADalyzer (AutoCAD Command Counter)

I’ve been working on a Ruby utility to analyze AutoCAD log files. The goal is to count how many times each command is invoked. The basic functionality is all in place, I’ve plans to add more in-depth analysis and perhaps even turn it into a web based tool. For now, you’ll have to download it and run it in the command line. If you want to run this, you’ll need the Ruby programming language runtime installed on your computer. Here is a link to the Ruby download. My CADalyzer utility can be downloaded here.

Download the .zip file, and unpack it. To run the utility, you will need to tell it where your AutoCAD log files are stored. (You can find that location in AutoCAD, via the Preferences.) Open the Cadalyzer.rb file and enter the path to your log directory next to the word path, like so:

Excerpt from top of Cadalyzer.rb file:

path = "insert full path to log file directory here"


The utility will combine & analyze the data from every log file in the directory specified.

Happy analyzing.

Acad - Saving Keystrokes!

(Or: How I Stopped Worrying and Learned to Love the Command Alias)

If you are an avid AutoCAD user, you know that setting up your command aliases is key. For those interested, I’ve put my customized portion of the acad.pgp file here.

For those of you who are not familiar with AutoCAD’s command aliases, you’re in for a treat. Every time you enter “rec” instead of “rectangle,” or “l” instead of “line” you are using a command alias. Te best part is that you can customize your aliases to your heart’s content.

Customizing your aliases provides a number of advantages. Brief bullet list:
  • Edit the shortcuts so that they make sense to you, not some guy at Autodesk.
  • Edit the shortcuts so that groups of commands are related.
  • Cut down on the overall number of keystrokes your numb little fingers enter during the day.
  • Select your most frequently used commands and try to reduce them to as few keystrokes as possible, even if other less frequently used commands have to be reassigned to have longer aliases.
Read More...

AutoCAD LISP routines

I’ve thrown a few of my most frequently used LISP routines on here. You’ll find the files & descriptions here or in the sidebar. I will be adding more as I clean them up and determine where I acquired them (so I can give credit where credit is due.) I am also tinkering with the idea of posting my pgp file; while not especially useful, I am always interested to see what shortcuts other people use. Perhaps someone out there feels the same way. I’ll think about that while you root around in the LISPs directory.

AutoCAD Imperial & Metric Conversions

Yesterday a friend asked me how to convert an AutoCAD drawing from metric to imperial. He needed to dimension in inches and draw imperial sized objects inside a metric drawing. Turns out the Autocad help is not so helpful on this specific subject.

Units & Units:
So here's the deal, AutoCAD “thinks” in a drawing units. These drawing units don’t have a real world size. The only relation to real world size they have is the name that we assign to them in the units dialogue box. But a name doesn’t mean a thing to AutoCAD. 1 metric drawing unit = 1 imperial drawing unit = 1 mile drawing unit.

Example: when you copy & paste a 12"x12" rectangle into any drawing, AutoCAD really pastes a 12 unit x 12 unit rectangle. If you paste that same 12”x12” rectangle into a millimeter based drawing, the rectangle will only be 12mm x12mm.  Likewise, a 12mm x 12mm rectangle pasted into an inch based drawing will become 12”x12”.
 
Conversion Factors:
These common conversion factors will help you out as you keep reading:
1 inch is 25.4 mm
1 mm is 0.0393700787 inches

There are two easy ways to solving cross unit woes in AutoCAD.

Soft-Convert:
If you only need to dimension a drawing with different units (e.g. a metric drawing with imperial dimensions,) you can create a dimension style with a SCALE (Dimension Styles > Primary Units tab.) The SCALE is the conversion factor.
So if my SCALE is 25.4, when I dimension a 1” line the dimension shown will be 25.4 (1 x 25.4 = 25.4)

Advanced tip: If you want to forgo the dialogue boxes, you can edit the current dimension style's scale directly by changing the value of the DIMLFAC variable.  Note that DIMLFAC creates a dimension style override (named "Style Overrides") that only alters the scale of the current dimension style.
 
Hard-Convert:
If you need to actually draw in imperial units when the drawing is in metric units, you will need to scale the objects in the drawing from mm to inch (or vice versa).  No settings or variables here; simply select everything in the drawing and use the scale command (& the correct conversion factors) to resize everything to your desired measurement unit. Now draw away.

A Note on Insertion Scale:
Something important to note. Many people get waylaid by the "Insertion Scale" field in the "Units" dialogue box. This does automatically scale inserted content to the selected unit, but only when you are inserting objects such as blocks, drawings, or images. If you need to paste cross-unit objects between drawings, writing them to a block and inserting may be your best bet. If you want, you can use the INSUNITS variable to change this setting.

Optional tip. You can also set the "Insertion Scale" to Unitless and specify the default source and target units in the "Options/User Preferences" dialogue box. Inserted objects will automatically scale between the source and target units you set, regardless of what unit the drawing file was created with.

The most useful information ends here. For those who program LISP routines, a rant follows...

It boggles my mind that AutoCAD does not have an optional real-time scaling factor built-in for drawing differing units in the same drawing. This would consist of 1) a global drawing unit, as supplied by the user or the template. This would tell Autocad what measurement unit the drawing is in. 2) A scaling factor would be calculated and applied to objects as they are drawn. AutoCAD would compare the entered unit to the global unit and apply the appropriate conversion factor to object drawn or edited. Perhaps the same can be achieved using a LISP routine. If there are any takers, please drop me a line.