puk
puk

Reputation: 16782

Is it possible to programatically create labels in AutoCad?

Our engineering department wastes a great amount of time reviewing drawings for errors. The majority of these problems involve human errors in labeling (ie. two rooms have the name 01-01-00-RM). Our IT department has come up with a partial solution by automation the room names. However, the engineers still have to type this into AutoCAD.

Is there any way to create labels in AutoCAD based on another file (ie. an Excel/CSV document)? Ideally, one would create a group in a layer and enforce that all elements be unique, then have them retrieve their values from a document.

EDIT

Some screenshots of the labels. Note, for company reasons, I can't put full PDF screenshots up.

First image showing compact label next to a camera. This was on a floor plan overlay.

enter image description here

Second image showing the full lable next to a camera. This was in the block diagram

enter image description here

Upvotes: 1

Views: 1904

Answers (2)

CAD bloke
CAD bloke

Reputation: 8808

If the labels were blocks with attributes then you could use the ATTOUT and ATTIN commands in Express tools to export / import them in to/out of Excel. Watch for cell formatting in Excel - eg. numbers like 1/2 turn into dates if you leave the formatting as "General".

Programmatically this is reasonably trivial if the data is structured. An AutoCAD drawing is actually a hierarchical object database so everything in it is addressable, finding it is often the hardest part. If you have an AutoCAD installation handy, have a look into a drawing with MGDDBG to get an idea of the database structure.

Upvotes: 0

Augusto Goncalves
Augusto Goncalves

Reputation: 8574

Yes it's possible, there some different paths:

  • Lisp: very common on AutoCAD environment and allow some basic (and not so basic) automations.
  • VBA/COM: can be used from inside AutoCAD or by external process, just need to CreateObject("Application.AutoCAD") and program the steps
  • .NET or C++: in-process automation that allow powerful customization, up to a major remodeling of AutoCAD.

So, depending on your expertise, you may choose different approaches. It may also combine with batch processing via AutoCAD Console.

Find more at http://www.autodesk.com/developautocad and at the blog http://adndevblog.typepad.com/autocad

Upvotes: 1

Related Questions