Generate dimensions automatically

Generate dimensions automatically

Anonymous
Not applicable
10,789 Views
17 Replies
Message 1 of 18

Generate dimensions automatically

Anonymous
Not applicable

Hello Everybody,

Please, is there any way to generate automatically the dimensions of all rectangles in a drawing like the rectangle 1 (see pdf attached) instead of doing that manually for every rectangle.

Thanks!

0 Likes
Accepted solutions (2)
10,790 Views
17 Replies
Replies (17)
Message 2 of 18

Alfred.NESWADBA
Consultant
Consultant
Accepted solution

Hi,

 

AutoCAD has the command _QDIM, but that seems not to be the same as you'd like to get.

 

But there exist tools, also in the forum for customization like >>>here<<< (or others, just search), so you can get close to your wish.

 

- alfred -

------------------------------------------------------------------------------------
Alfred NESWADBA
ISH-Solutions GmbH / Ingenieur Studio HOLLAUS
www.ish-solutions.at ... blog.ish-solutions.at ... LinkedIn ... CDay 2026
------------------------------------------------------------------------------------

(not an Autodesk consultant)
0 Likes
Message 3 of 18

jayhar
Advisor
Advisor
Accepted solution

Hi,

Watch this Screen casts Video & see the attachments

Or

click here https://autode.sk/2SdqayZ

 

Please Mark the Post or Posts as Solution(s) to help others find the answer quickly. If your issue persists,

Please give me a bit more detail on this issue so we can continue to work towards getting this solved.

Thanks You
Jayhar.M.J

 

Helpful Links: Prepare your computer for download |  Autodesk Virtual Agent | Clean Uninstall | Steps for Setting-Up Student Software

 

Please Subscribe YouTube Channel
https://www.youtube.com/channel/UCclj8v9vHQiFa8_DriuAk3w

Please Mark the Post or Posts as Solution(s) to help others find the answer quickly.
Message 4 of 18

Kent1Cooper
Consultant
Consultant

Following a link in @Alfred.NESWADBA's link, to >here<, it wouldn't be difficult to adjust the commands in DimPoly.lsp to Dimension only two sides of rectangles, but questions arise:

 

Will the rectangles always be orthogonally oriented?  If so, it wouldn't be hard to get it to Dimension the top- and right-side edges only.  If not, how should a routine decide which two sides to put Dimensions on?  For instance, if one is rotated at a 45-degree angle, should it Dimension the two edges that meet at the top corner, or the two that meet at the right?

 

If you want to select multiple rectangles at once, those commands are for Polylines of any shape, open or closed.  It's possible to adjust it to filter the selection to find only closed 4-vertex Polylines, but that could still "see" some Polylines that are not rectangular, including some with arc segments.  Should a revised command test Polylines in the selection to find whether they're rectangular before Dimensioning them?

 

Might you ever have rectangles that are visually closed but not truly closed by AutoCAD's definition?  That is, with 5 vertices instead of 4, with the last one at the same place as the first?  That would complicate the analysis, but could probably be accommodated.

Kent Cooper, AIA
Message 5 of 18

olijbailey
Explorer
Explorer

Hi,

 

The Outside DIM LISP solution is brilliant but I find it doesn't work on a wider zoom level. Can anyone think of a reason this might be?

0 Likes
Message 6 of 18

cadffm
Consultant
Consultant

Hi,

 

the code doesn't check your running osnap settings in automation

(and it does not set snapmodes and not the current view).

 

The code needs additional lines to handle osnaps (you need them gor associated dims and to snap the right point on objects)

and the current view (because osnaps working view depending)

 

 

Sebastian

0 Likes
Message 7 of 18

Kent1Cooper
Consultant
Consultant

@olijbailey wrote:

.... The Outside DIM LISP solution is brilliant but I find it doesn't work on a wider zoom level. Can anyone think of a reason this might be?


That's my DimPoly.lsp routine [and still calls itself that at the top commentary] -- why @jayhar changed the file name to suggest only outside, I can't imagine, since it still includes the inside-option command.

 

But "doesn't work" is never enough information!  @cadffm can't be right that it's an Object Snap problem, because it does deal with Osnap to do its thing [see lines 23, 30, 33, 135].  Some kinds of "doesn't work" are commonly the result of running Osnap that should not be on, but if it can't be that, what does "doesn't work" mean?  What happens that you don't expect?  What doesn't happen that you do?  Does it do part of it but not all, and if so, how far does it get?  Are there any messages?  Etc., etc.

 

I tried that specific file, just in case it had been altered from my original in some way that caused your problem.  But it works fine for me, even when Zoomed so far out that I can't even distinguish objects in selection, and even when Zoomed so far in that only a small portion of a Polyline is visible on-screen to select -- it still Dimensions all of them correctly in both cases.

Kent Cooper, AIA
Message 8 of 18

cadffm
Consultant
Consultant

", because it does deal with Osnap"

Sorry,

I overlooked it because of my 6" device and just searched for osmode/osnapcoord (and I thought it will create assoc dims).

Shit happens, sorry again.

 

 

EDIT: Back at my 32" - I confirm, there is nothing in the linked code dimpoly (and the unfortunately renamed identical file outside dim.lsp) what is view dependent. I can't get it fail.

@olijbailey Tell us more about the issue and share your sample .dwg, zoomed to the view you have problems with.

 

@Kent1Cooper I found another tiny Issue. Add a current-space filter to the ssget statement,

this way users can't select objects in other spaces (and dimpoly will not add dimensions for it in the current space)

(ssget "_:L" (list '(0 . "*POLYLINE")(cons 410 (getvar 'CTAB))))

 

Sebastian

0 Likes
Message 9 of 18

Kent1Cooper
Consultant
Consultant

@cadffm wrote:

.... Add a current-space filter to the ssget statement,

this way users can't select objects in other spaces (and dimpoly will not add dimensions for it in the current space)

(ssget "_:L" (list '(0 . "*POLYLINE")(cons 410 (getvar 'CTAB))))


Not necessary.  The User can't, by User selection in (ssget), select things in other than the current space anyway.  You obviously can't select such things by picking/window/lasso, and it won't accept "Last" or "Previous" if that happens to be [or include] a Polyline in a different space.  The situation in which that current-space-only filter limitation is relevant is when you want to find all of something without User selection, where you would include the "_X" or "_A" selection mode which can find things in multiple spaces, but you want only those in the current space.

Kent Cooper, AIA
0 Likes
Message 10 of 18

cadffm
Consultant
Consultant

>"it won't accept "Last" or "Previous"

Wrong, but nobody will use "previous" if he came from another space, but selection method ALL works also!

 
 

 

 

Sebastian

0 Likes
Message 11 of 18

cadffm
Consultant
Consultant

 


@cadffm wrote:

(ssget "_:L" (list '(0 . "*POLYLINE")(cons 410 (getvar 'CTAB))))


Not good enough,  if we think about Users who using a layout viewport to edit modelspace content.

but this

(setq dpss (ssget "_:L" (list '(0 . "*POLYLINE")(cons 410 (if (or (= 1 (getvar "tilemode") 1)(< 1 (getvar "cvport"))) "Model" (getvar 'CTAB))))))

Sebastian

0 Likes
Message 12 of 18

olijbailey
Explorer
Explorer

Hi @Kent1Cooper 

 

Thanks again for writing this script and sharing it. The problem is definitely with my drawing, which is unsurprising, given that I am not a CAD professional. Attached is an example. I don't know what I'm doing wrong. Dimension style perhaps? I seem to be able to successfully run the auto dimension script at close zoom levels but not when zoomed out. Ideally, I want to apply it to all polyline objects on the drawing in one go. There are no error messages or anything I can see that will give me a clue. Sorry. Once again, I appreciate your help.

0 Likes
Message 13 of 18

cadffm
Consultant
Consultant

Hi,

 

My I ask for this .dwg and a view/zoom which works??

 

The issue are three Polygones with nonsensical form (vertex 4, area 0)

and the both blue marked rectangles with a side <= 2.0, which will fail

cadffm_1-1721987245767.png

 

 

 

Sebastian

0 Likes
Message 14 of 18

olijbailey
Explorer
Explorer
Right. I guess my point is that it does work at closer zooms. 0.000177, for example
0 Likes
Message 15 of 18

olijbailey
Explorer
Explorer

Here's a quick screen recording.

0 Likes
Message 16 of 18

cadffm
Consultant
Consultant

Hi,

 


@olijbailey wrote:
Right. I guess my point is that it does work at closer zooms. 0.000177, for example

No, it has nothing to do with zoom, just with your object selection

(while in zoom 0.000177 you NOT selected the same objects!)

 

As I tried to explain above in details, you have 5 Element what are invalid.

3 are nonsens, 2 are to small for the settings.

 

Take time, and delete the 3 objects and the 2 other ones: Don't select them (or edit the with to >2)

 

A close look to one the object (the most right marked):

cadffm_1-1721998219173.png

 

 

 

 

;===============================================================

Hi,

My I ask for this .dwg and a view/zoom which works??

The issue are three Polygones with nonsensical form (vertex 4, area 0)

and the both blue marked rectangles with a side <= 2.0, which will fail

cadffm_0-1721998089221.png

;===============================================================

 

And my I ask why you are wotking inside a viewport? Instead of the MODEL TAB

 

Sebastian

0 Likes
Message 17 of 18

olijbailey
Explorer
Explorer
Now I see it. Thank you. There were errant objects hidden underneath the rectangles in those instances!
0 Likes
Message 18 of 18

aadish_bin_abdul_sathar
Contributor
Contributor

thank you very much 🙂

0 Likes