Community
AutoCAD LT Forum
Welcome to Autodesk’s AutoCAD LT Forums. Share your knowledge, ask questions, and explore popular AutoCAD LT topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Macro to Automate placing lengths of lines in AutoCAD LT 2012

13 REPLIES 13
Reply
Message 1 of 14
mel
Participant
1241 Views, 13 Replies

Macro to Automate placing lengths of lines in AutoCAD LT 2012

If I have a series of lines on a layer, is it possible for a macro to place a label for the lengths of the lines at the center of each line in AutoCAD LT 2012? Adding a DIMLINEAR to each line is for the birds....my drawings have as many as 250-300 lines that need to be labeled with thier lengths.......

13 REPLIES 13
Message 2 of 14
Charles_Shade
in reply to: mel

Do you need to draw the lines freehand or could a Block be used?

Message 3 of 14
pendean
in reply to: mel

If I may ask, what command would you use to do this? a Macro in LT is the same as typing it at the command line for the most part, there is no secret 'code' to do any more that than in LT.

 

You could speed up DIMLINEAR if that's the format you need with a macro, since you only need to pick the line to dimension it and not it's end points. So now you are down to two clicks instead of four, and the macro restarts over and over again until you tap ESC cancel button on your keyboard:

*^C^C_dimlinear;;\\

 

If the lines are in a row/series, perhaps DIMCONTINUE command is what you need?

Message 4 of 14
mel
Participant
in reply to: mel

Please see attached PDF file for explanation of what is needed.

 

Thanks

Message 5 of 14
hwalker
in reply to: mel

Not in one click that won't happen.

 

You've got too many different length lines to have a macro do what you want in one click.

 

Howard Walker
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature


Left Handed and Proud

Message 6 of 14
drjohn
in reply to: hwalker

As Charles quietly queried, will a block do?  Maybe a dynamic block (just a line) with a field maybe.

 

Dynamic blocks don't have to be complicated.  Just a line with a stretch pair and the field attached to the line length.

 

 

2 cents.

 

 

Regards,

DJ

 

Message 7 of 14
Charles_Shade
in reply to: drjohn

I was thinking along those lines but each would have to be Stretched to length. Not sure this would be easier

I do much the same now with Copy and Extend to acheive what the OP has drawn but putting the length at each is the issue.

Maybe a Dimstyle that had these parameters? One by one by one by...

Though with the Dynamic Block and Attrib you could output the info to a file.

Message 8 of 14
pendean
in reply to: mel

The DIMLINEAR macro modified to use DIMALIGNED instead that I posted is the quickest way to do what you seek: assuming you got what I meant by you don't need to click four times to get a single dimension, just two.

Message 9 of 14
mel
Participant
in reply to: mel

Yes, I use the DIMALIGNED with a DIMSTYLE to factor in the roof pitch....and yes two clicks per line....that's what I need to automate.....two clicks per line times the number of lines I have....for the birds.....

 

Thanks

Message 10 of 14
pendean
in reply to: mel

My first macro above (read the description that went with it):

*^C^C_dimlinear;;\\

The second (untested):

*^C^C_dimaligned;;\\

 

There are many youtube videos to show you how to create macros in CUI command. help yourself.

Message 11 of 14
mel
Participant
in reply to: mel

Just need a way to select the lines I need to put the DIMALIGNED on and have it do all the lines selected. I just don't want to pay 5-6 Grand for this little feature in a LISP program in full AutoCAD.....surely there is way in LT.....LT has come a long way.....maybe a DIESEL expression in macro somehow?

Message 12 of 14
pendean
in reply to: mel

DIESEL is listed in HELP in LT2012, explore it yourself and find out what it can and cannot do, plus these:

http://thecadprogcp.blogspot.com/2009/10/diesel-programming-in-autocad-lt.html

http://www.upfrontezine.com/tailor/tailor17.htm

http://www.crlf.de/Dokumente/Diesel/Diesel5.html

 

You can wait for others to jump in if there are other ideas.

Message 13 of 14
steven-g
in reply to: mel

You mention scripts and macro's using diesel so I take it you are happy with how they work and how to put them to use.

This isn't a fully working option, but hopefully will give you a starting point. It works with one click but does need some preparation.

You need to split your areas into separate polylines and rotate them to horizontal, the attached drawing shows you what I mean.

Also in the drawing are 2 text items one is a script, copy the text into notepad and save it with the name "dim.scr", make sure this file is saved into your support path or add the path in autocad options. The second text item is a macro listing which you can copy into a toolpalette.

When the script and macro are in place, click on the toolpalette for the macro, it will ask you to specify a point, the point should be the bottom left hand corner of a polyline, the polyline will move be dimensioned and be shown at your cursor to be placed somewhere in your drawing.

Couple of points to look for, the rectangle needs to remain clear, and the polyline needs to have a lower left corner as the extreme limit (for example item 5 at the top of the drawing wont work and would need mirroring). And some items will need the dims to have additional trimming where the top overhangs the base (e.g.. item 4).

 

There are a number of ways this could be improved and adapted, so play with it see what it does, and adapt

Message 14 of 14
mel
Participant
in reply to: mel

Thanks steven-g, that's awesome! This definately gives me something to work with.....Thanks Again!

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost