Pline Dimensioning

Pline Dimensioning

Anonymous
Not applicable
16,150 Views
55 Replies
Message 1 of 56

Pline Dimensioning

Anonymous
Not applicable
Does anyone have a lisp to place aligned dimensions on each segment of a polyline?

I would use it for reinforcing bar detailing.
Thanks for any other suggestion.

Matthew
0 Likes
16,151 Views
55 Replies
Replies (55)
Message 41 of 56

CodeDing
Advisor
Advisor

@Anonymous ,

 

Try updating the following section within the "DimPoly" code, by adding these 2 items:

                    (progn ; else [arc segment]
                      (setq dtxt
                        (rtos
                          (abs ; length along arc segment
                            (- (vlax-curve-getDistAtParam pl inc) (vlax-curve-getDistAtParam pl (1- inc)))
                          ); abs
                          (getvar 'DIMLUNIT) 2 ;; [include mode/precision here if current dimension style's settings not desired]
                        ); rtos
                      ); setq

Best,

~DD

0 Likes
Message 42 of 56

Anonymous
Not applicable
Hi, I don't know exactly where I need to introduce these changes and if I should remove some lines. thanks!
0 Likes
Message 43 of 56

CodeDing
Advisor
Advisor

@Anonymous ,

 

Try attached lsp file. I only added the 2 items I recommended in my previous post.

I have not read this whole thread, so I merely downloaded the last "DimPoly" file provided by Kent. I hope this is what you need.

I am unable to test this since I have no idea what its sole-purpose or given context is.. So if this edit does not work for you, then I will not be able to help further.

 

Best,

~DD

0 Likes
Message 44 of 56

Anonymous
Not applicable

hi, it worked with an older version of the routine. Thanks!!

Message 45 of 56

rreyesDEZ2W
Explorer
Explorer

@Kent1Cooper 

Kent1Cooper I wanted to ask and see if you could help me edit the lisp you wrote to have the dimensions all be end up at a certain distance from the polyline, on all 4 sides of the polyline. Maybe varying distances depending on the side? Also if there is a way to only dimension from the outer most vertices so that the dimension lines don't overlap with the polyline itself.

@CodeDing 

CodeDing, maybe you can help me? I see that you replied to someone most recently.

 

I've attached a dwg of what I mean incase I wasn't able to clearly explain myself. I'm new to AutoCad so any and all help/tips/ideas are welcomed and appreciated. 

0 Likes
Message 46 of 56

damielcruz150
Contributor
Contributor

How do i adjust the distance from the polyline i been playing around but not lucky

0 Likes
Message 47 of 56

Kent1Cooper
Consultant
Consultant

@damielcruz150 wrote:

How do i adjust the distance from the polyline ....


Which routine do you want to adjust?  [The person you Replied to isn't the author of any of them.]  If it's my code at Message 30, change this line:

 

(* styht 1.5); distance

 

That puts the dimension line position at 1.5 times the text height in the Dimension Style from the Polyline [see the notes at the top of the file].  Change the 1.5 to whatever you prefer [larger = farther from the Polyline].

Kent Cooper, AIA
0 Likes
Message 48 of 56

larsr2866
Enthusiast
Enthusiast

Hello Kent1Cooper,

 

I have a question. I have tried this lisp to make this also work for lines  (instead of polylines), by changing 

(if (setq dpss (ssget "_:L" '((0 . "*LINE")))) but it doesn't work. It says 'ERROR bad argument type: fixnump: nil'.

 

Can you help me with this ?

 

Thanks in advance.

0 Likes
Message 49 of 56

Kent1Cooper
Consultant
Consultant

@larsr2866 wrote:

.... I have tried this lisp to make this also work for lines  (instead of polylines), by changing 

(if (setq dpss (ssget "_:L" '((0 . "*LINE")))) but it doesn't work. It says 'ERROR bad argument type: fixnump: nil'.

....


Lines and Polylines store their information in very different ways, so you can't just change the object selection part.  For example, parameter values [used to save vertices into variables] have an entirely different basis for a Line than for a Polyline.  The error is probably coming from the fact that a Line doesn't even have a DXF-code 70 entry which the commands use to test whether a Polyline is of a type they can work with.

 

A similar routine could be made to work with Lines, but what should be the basis for determining "inside" and "outside" or other criterion for which side to put the Dimension on?

 

By using "*LINE" with the asterisk wildcard, you allow the selection of not only Lines but also Polylines and Splines and Mlines and Xlines.  If you meant something to work on Lines only, the asterisk should go.  If you want Polylines and/or Lines, there are other elements needed to prevent selection of those other object types, or maybe to allow selection of them but bypass them in processing.

 

[Also, do I assume correctly that you're talking about the latest version at Message 30?]

Kent Cooper, AIA
0 Likes
Message 50 of 56

larsr2866
Enthusiast
Enthusiast

Thanks for your reaction.

 

Infact i would like to change the entity often, because i work with al lot off different entities (lines, polylines, areas, shapes, polygon). So i was hoping i could make for each entity a defun by changing it in the routine. I would always like to use the "inside" of the shape/areas to make dimensions.

0 Likes
Message 51 of 56

Kent1Cooper
Consultant
Consultant

@larsr2866 wrote:

... i would like to change the entity often, because i work with al lot off different entities (lines, polylines, areas, shapes, polygon). So i was hoping i could make for each entity a defun ....


For things like this, it is usually possible to have a single command that allows selection of multiple entity types, and just processes different entities according to their characteristics.  It should not be necessary to have a separate command for each type.  But questions arise:

I imagine a "polygon" is really just a Polyline [at least that's what the POLYGON command makes -- there's no "polygon" entity type], but what are the entity types of what you call "areas" and "shapes"?  Are they not also just Polylines?  Or possibly  Regions?  Hatch patterns?  Maybe [2D] Solids?  3DFaces?  Traces?  Mlines?  [Presumably not things that would qualify as "areas" or "shapes" but for which dimensioning around the inside would probably be meaningless, such as Circles, Ellipses or Splines.]

 

And again:  What would determine to which side of a Line the Dimension should go, since of all the entity types I imagine you would choose, Lines most clearly don't have an "inside"?

Kent Cooper, AIA
0 Likes
Message 52 of 56

larsr2866
Enthusiast
Enthusiast

I would mainly like to get this work for the entity 'CL_area's (it's a entity name of a proxy object, closed intelligent objects for drawing areas). I have also changed older lisps with the entity 'CL_area' and it always worked.

 

I would like to make a routine where its makes dimensions on all the inside sides of this  closed proxy objects.

0 Likes
Message 53 of 56

Kent1Cooper
Consultant
Consultant

@larsr2866 wrote:

....f a proxy object, ....


[Those are beyond my experience.  Is there a Forum for whatever software the proxy objects came from?]

Kent Cooper, AIA
0 Likes
Message 54 of 56

Kent1Cooper
Consultant
Consultant

For a new request >here<, I've adjusted the routines [see the attached] to do arc segments by DIMARC instead of as Angular Dimensions with text override, and to let the User specify how far off the Polyline the Dimension line should be, within the command instead of needing to edit the code.  See the comments at the top of the file.

Kent Cooper, AIA
0 Likes
Message 55 of 56

laurens146
Contributor
Contributor

 Your routine was not yet able to fully dimension the polylines I was dealing with.

I have added the portion of your routine that defines the offset from the object to another similar routine called
auto dimension. The command can be called using "ADnow" after loading the lisp routine.
It asks the same user input "Offset of dimension lines from Polyline as multiple of text height" as your command.
Thank you for your valuable work on this routine It was extremely easy to integrate by just telling chatgpt tot add the function to the original AD.lsp routine.

This will be of great benefit for my colleagues, work. 

0 Likes
Message 56 of 56

Kent1Cooper
Consultant
Consultant

@laurens146 wrote:

 Your routine was not yet able to fully dimension the polylines I was dealing with.
.... 


I'm curious -- can you post a small drawing file with a few examples of Polylines that it didn't fully dimension?

Kent Cooper, AIA
0 Likes