Hi everyone,
I used to have a LISP routine that would place dimension of the height and width of a rectangle, just by selecting the rectangle, or poly line.
I do not have that LISP anymore, and have looked everywhere on the internet for something similar, but cannot find exactly what I used to have. I know alittle about editing or modifying a LISP routine, but don't feel comfortable in editing the ones I have found, that worked somewhat for what I was looking for.
Does anyone know where I could find such a routine, to simply place dimensions for the height and width of any polyline rectangle? Ive attached drawing of what I am looking for. Thanks in advance
Solved! Go to Solution.
Solved by Kent1Cooper. Go to Solution.
You can use DimPoly.lsp, available >>here<<. It could be adjusted easily enough to do only two sides of a rectangle, if it otherwise does what you want. See other Posts on that thread for certain possibilities, and other code. Also consider such things as using a Dimension Style with extension and dimension lines suppressed if all you want to see is the distance text part, etc.
Thanks for the quick reply Kent. I liked the LISP you reference to ......it does however, put dimensions on all sides of the rectangle. How could I modify the LISP to remove those two sides, when I only want just the height and width?
@Anonymous wrote:
.... How could I modify the LISP to remove those two sides, when I only want just the height and width?
If you don't care which two consecutive edges get dimensioned, and you plan to use it only on rectangles, I think you could just change this line:
(repeat (setq inc (fix (vlax-curve-getEndParam pl)))
to this:
(repeat (setq inc 2)
It could also be simplified in a lot of other ways, particularly eliminating its accounting for arc segments, coincident vertices, open-vs-closed Polylines, and so on, but those elements won't hurt if left in, even if they're not used.
If the particular edges dimensioned matter, it could probably be made to figure out where it is, and only do whichever you want [for example, the left and bottom edges]. But that raises the question of whether the rectangles are always orthogonally oriented. If not, there would need to be some criterion developed for which two edges to do, when a rectangle is at some oddball angle.
That worked great!
I noticed when I the dimension was placed, it was placed very close to the rectangle (3/16"), almost overlapping it. How could I go about modifying the LISP routine to make that distance further?
@Anonymous wrote:
... it was placed very close to the rectangle (3/16"), almost overlapping it. How could I go about modifying the LISP routine to make that distance further?
That's determined as a proportion of the text height, by this line:
(* styht 1.5); distance
so if you change that 1.5 to something larger, they'll be farther away.
Thanks so much for all your help!
I plan on educating myself in writing LISP routines this year. They are such a great thing for AutoCAD
how could I alter the Code so I could use this for general Squares and rectangles and still use DPO/DPI for tougher shapes?
Hi Kentcooper,
Your autolisp very useful, but if i only want to use your autolisp for only dimension line and no need dimension aligned, how i can modify it ? Thank you so much
@Anonymous wrote:
.... if i only want to use your autolisp for only dimension line and no need dimension aligned, how i can modify it ? ....
That's actually quite a bit more complicated than you might think, but probably possible -- I'll have to think about it. In the meantime, the QDIM command can do much of what you want, though you'll need to run it four times on each Polyline, and it will make more Dimensions than in your image examples, because [for example] its left-side Dimension string will pick up vertices along the right side. But if you can [even temporarily, and re-join later] Explode the Polylines into Lines, you could get QDIM to do exactly what you want. And it has the advantage of not having extension lines overlapping orthogonal edges.
Looking at the image again, I have some questions.
You have a second overall Dimension on the right end of the bottom right figure, but no other overalls along sides with more than one Dimension. I assume that's because there's no single edge on either end of the figure to Dimension that overall height along. It would be a serious challenge to figure out how to instruct a routine to determine that. Is the overall Dimension something you would want the routine to draw, rather than putting it in yourself where needed?
Many of your strings of multiple Dimensions along the same side are continuous, but some are stepped. Is that a matter of how crowded the text is between the extension lines on the ones that are stepped? Again, telling a routine how to figure that out, and what to do about it, would be difficult.
Would you ever have a concave situation such as this?
How should that be handled?
Not really a routine's problem, but a question of how you draw and how you define your Dimension Style: I notice that the Polylines are not drawn with precision and the Dimensions are rounded, because [upper-right figure] 377 + 99 does not equal 475.
Hi Ken1Cooper,
Thanks for your advice, actually your autolisp is near my requirement after i surveyed many others. Unfortunaly, I do not know as well as designing a autolisp, only seeking and use. So that when i found your autolisp, i am very happy but it is so useful and more than what i need, though i only need dimension as width and length. Again, great thank to your support.
Dear @Kent1Cooper ,
I have a question about a way to automatically dimension polyline with coordinate dimensions. Is that possible? If the same dimensions were shown on the right / left and top / bottom, this is not a problem for me, I can simply power-delete some dimensions.
An sample :
Many thanks in advance
The values would have to be overwritten.
Do you have dim styles set for both directions?
What is the original shape made from, lines or pline?
Post that image as dwg!
@Anonymous wrote:
Dear @Kent1Cooper ,
I have a question about a way to automatically dimension polyline with coordinate dimensions. ....
[I defer to your other specific-to-this-question thread. Not that I have a solution there, but anyway.... And just to be nit-picky, they're called Ordinate (not Coordinate) Dimensions.]
Dont double post it makes it confusing that you will get different people trying to solve the same question.
Can't find what you're looking for? Ask the community or share your knowledge.