Announcements

Starting in December, we will archive content from the community that is 10 years and older. This FAQ provides more information.

Dimension Extension Line overlapping

Anonymous

Dimension Extension Line overlapping

Anonymous
Not applicable

Hi All,

My attached drawing have many dimension with some of that have extension line is overlapped with other objects.

Anyone have a lisp routine below:

- Detect all dimension's extension line is overlapped

- Move those point to near dimension's base line such as 100 mm

 

img_02.jpg 

Thanks all in advance for any support.

 

P/S: Please write some simple comment in lisp if you can because I am learning basic of Lisp.

 

Regards,

HAI

0 Likes
Reply
6,733 Views
60 Replies
Replies (60)

ВeekeeCZ
Consultant
Consultant

Autocad has a built-in function that breaks crossing dimensions: DIMBREAK. It even allows you to select multiple dimensions.

If your extensions lines are too long, you can use a fixed length.

 

image.png

 

Or... if you want to get better in your programming skills, then actually start programming! Write your own routine!

0 Likes

Anonymous
Not applicable

Thanks @ВeekeeCZ  again.

 

I knew DIMBREAK command before but it is not fit my request. My issue is Dim extension line is overlapped with other lines. DIMBREAK just for crossed line with dimension ext line.

 

Actually I have a converted drawing from other software, I do not create new dimensions. So I need to detect and fix the overlapped extension line (above image).

 

- This routine is just like with overlapped line with line but this time is dimension extension line with other objects.

- I think this problem can be solved with X,Y DXF group of dimension definition point. And then detect overlapped with others objects. But my Autolisp knowledge is just really basic. I can not do that for now.

 

Regards,

HAI

0 Likes

ВeekeeCZ
Consultant
Consultant

Just quick and easy. I would not bother big thinking... and set it all to a fixed ex-lines with length let say 8.

Or you could filter out the horizontal and set them less. Or some appropriate combination of both... which is up to you. 

 

(defun c:DimHorFixed (/ ss th i en)
  
  (if (setq ss (ssget '((0 . "DIMENSION"))))
    (repeat (setq i (sslength ss))
      (setq en (ssname ss (setq i (1- i))))
      (if (equal (getpropertyvalue en "TextRotation") (/ pi 2) 2e-2)
	(progn
	  (setpropertyvalue en "DimfxlenOn" 1)
	  (setpropertyvalue en "Dimfxlen" 5.)))))
  (princ)
  )



(defun c:DimFixed (/ ss th i en)
  
  (if (setq ss (ssget '((0 . "DIMENSION"))))
    (repeat (setq i (sslength ss))
      (setq en (ssname ss (setq i (1- i))))
      (setpropertyvalue en "DimfxlenOn" 1)
      (setpropertyvalue en "Dimfxlen" 8.)))
  (princ)
  )
0 Likes

Anonymous
Not applicable

Thank @ВeekeeCZ 

 

But I think you are misunderstanding my issue.

Your routine set all selected dimension to 8 length. But I just need to detect and move just only overlapped dimension.

Please see attached image.Screenshot_1.jpg

 

0 Likes

Kent1Cooper
Consultant
Consultant

Don't bother moving the definition points, which will lose the connection to keep the Dimensions correct if you Stretch the drawing content.  Just suppress the extension lines.  If you know which one is extension line 1 and which is 2, you can turn off  the one you want suppressed in the Properties palette:

ExtLines.JPG

Just change one or both of those to Off.

 

BUT  better yet -- since I rarely know which is 1 and which is 2, rather than try switching one and see whether I chose the right one, I wrote DimExtLineToggle.lsp, with its DET command, available >here<.  It's a true toggle -- it turns the extension line closer to where you pick [whichever that is] off if it's on, and vice versa.  See the description there, and comments in the code.  It does require you to pick each one -- having a routine detect  such conditions seems a near-impossible task, but maybe there's some way to do it.

 

For drawing Dimensions with one or both extension lines suppressed, read about the DIMSE1 and DIMSE2 System Variables.  Some people set up different Dimension Styles with one, the other, and both suppressed.

Kent Cooper, AIA

Anonymous
Not applicable

Thanks for your support @Kent1Cooper 

 

Your routine is clean, detailed commend, and I will learn many thing from it.

It worked well but sorry maybe I must find more solution to detect overlapped ext line automatically. Because my converted from other tool to dwg, so it have many many overlapped ext line. I cannot do it once by once.

 

If you have any idea to detect and turn off or move definition point, please support me.

 

Thank everyone so much.

All of you are amazing.

0 Likes

Anonymous
Not applicable

Happy with any advice or supports. 😀
Please help me or maybe I will rent anyone to solve my problem.

Thanks in advance.

0 Likes

hak_vz
Advisor
Advisor

Here you have my test code for two functions CDL and CDLI.  Function cdl ask for dimension line object to be selected and then ask for a cutting edge to align end points of all dimension line objects selected. Function CDLI works in a same manner but changes only internal extesion lines from selected and those on the total left and rigth side (first and last) do not change. By combining those two commands you can acheive what you looking for. It is best used on horizontal and vertical dimension lines, while aligned may create an error. It doesn't make filtering for other types of dimension object i.e. angular so select object with care.

Miljenko Hatlak

EESignature

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.

Anonymous
Not applicable

I cannot test the Lisp file now but I think need to thank you first because it take your time for my problem. Hope you understand my issue and help me solve this issue. Maybe I will send you a small payment for grateful.

Actually I need to find a good solution to detect the overlaps of dimensions and other lines. There are not only 1 case but also some different case of dims and line’s position.

I know it is not easy but with my current lisp knowledge I think can do it.

Btw thank you so much. I will reply tomorrow for result.

0 Likes

hak_vz
Advisor
Advisor

Here is a slightly changed code.

Miljenko Hatlak

EESignature

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.

Kent1Cooper
Consultant
Consultant

@Anonymous wrote:

…. I need to find a good solution to detect the overlaps of dimensions and other lines. There are not only 1 case but also some different case of dims and line’s position.

I know it is not easy ....


That's right -- it will not be easy.  Presumably a routine would find all Dimensions that have extension lines [easy enough, and it could ignore those without, such as Radius & Diameter].  The hard part would be determining overlaps of the extension lines with other things.

 

The entity data for a linear Dimension includes the definition points and only one  of the arrowhead ends of the dimension line where it meets an extension line.  That location at the other end would need to be calculated [you can see that done in the DET code].  The extension-line offset from the definition points and extension past the dimension line are obtainable from the Dimension Style.  So with all that, it could calculate the two ends of the two extension lines.

 

To find overlaps of those with other things, presumably it would use (ssget) with a Fence selection, and remove the Dimension itself from the resulting selection set.  Presumably it could also ignore other Dimensions  with coinciding extension lines.  If finding anything  else means it should suppress that extension line, that shouldn't be too hard.  But I assume you wouldn't always want that, if there could be things that partially  overlap.  I can imagine situations in which moving the definition point could be what's needed, and others in which it's not.  And any evaluation would be different if the overlapping thing is a Line than if it's part of a Polyline, or a piece of a Block, or....

 

A further complication is that the (ssget) with Fence selection would also find things that merely cross  the extension line, but don't lie along it, which presumably would not require altering the Dimension.  That's another evaluation that could be quite complex depending on entity types.  But I can't think of any other way to find overlapping things.

 

It's a daunting task, if achievable at all.

Kent Cooper, AIA

Anonymous
Not applicable

Hi Kent1Cooper,

 

Thank you very much. You are professional with good thinking. Thanks again for your detailed explaining the solution for me.

 

Actually my case is not really complex. I can make it more simpler. Please read below:

- Now I have a function to move all def points of dimensions (dxf 13, 14) to base line (dxf 10) working well. (From Roy_043 cadtutor forum)

- Because I just need to detect overlaps of dimensions and lines (no part of block or something, I will explode polyline to detect overlap easier)

- So, my idea: I will make a small ssget cross selection (maybe 2mm square) at 2 of ext line point (dxf 14) and def point (dxf 10) to select all lines which are overlapping with dimensions.

- When I have a set of line and one of ext line XYZ informations. I will make some maths to know what position of dim points compare with line end points.

- Then I make an action to move def point after knew relation of them.

 

P/S: I think just with that idea, I can solve my problem easier but with my very basic LISP knowledge and have yet to learn Visual Lisp. It is still difficult for me to write good optimize lisp.

 

@Kent1Cooper: Do you have time to help me this part? (Rotated dimension and Align dimensions) I will pay for your time.

 

Thanks again for your helping.

0 Likes

Anonymous
Not applicable

It is not working for me. Can you take a screenshot of result because I do not understand about select 2 point for cutting.

 

Thank you so much.

0 Likes

hak_vz
Advisor
Advisor

@Anonymous wrote:

It is not working for me. Can you take a screenshot of result because I do not understand about select 2 point for cutting.


This are either pick points on edges of the wall, points on extension lines, or any line you want to align edges off dimension object. I created it this way for simplicity and faster work.

Here is example for using command CDL to align  all extension lines to wall line.

 

a) When asked to select dimension objects:

slope7.jpg

b) when asked to pick first point on cutting edge ( it is a rectangle end point)

slope9.jpg

c) when asked to pick second point on cutting edge we select point on the right side, but it can be any point along that line, it just have to be horizontal to first one

slope10.jpg

And after selection of points along a line all extensions align to desired line. Same principle works for verticals.

slope11.jpg

And here is a example for using command CDLI. Here we want to shorten (cut) extension line at imaginary line created by picking two points  at dimensions it intersect with, but won't to align only internal points, and leave edge points untouched (13 14).

 

a) Here we select only outer dimension object.

slope13.jpg

We pick a first point approximately in the middle of segment, or how you like it.

slope14.jpgslope15.jpg

And a second point at other side at approximately same horizontal position. If you want to be precise you may draw a helping line or a rectangle.  Mouse cross is at position of a shortened dimensions edge line(s).

slope16.jpg

 

Miljenko Hatlak

EESignature

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.

Anonymous
Not applicable

Hi hak_vz,

Thank you so much for detailed explaining.

 

But sorry I think it is just a little bit misunderstand what I need to do. If you can please confirm my first post again.

 

If just cut dim by manually I have a lisp to cut dim's ext line with just 1 click (hor & ver) like your routine. Actually My drawing have many overlapped dim's ext line with other line (above post's images).

And I need to detect them automatically (cannot select and click one by one) and fix them.

 

Thank you.

0 Likes

hak_vz
Advisor
Advisor

Can you assure that automatic operation want delete what's not necessary. If you want me to put automation in a code then please tell me how you want cuts to be done i.e at line of previous dim object. Anyway as @Kent1Cooper  says its really hard to put into account all variables. Personally I always  prefer to have control over what automation code is doing. Also, update some sample drawing for easier work (version 2014).  

Miljenko Hatlak

EESignature

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.

hak_vz
Advisor
Advisor

I have some idea on my mind and will try to implement, but please provide some sample drawings (ver 2014). I work in a industry where precise detailing is not so often. Have to go now but will try to make some code later today.  

Miljenko Hatlak

EESignature

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.

Anonymous
Not applicable

Thank for quick reply hak_vz,

 

I know this problem is not easy for me. But I think it can be done with some pro supporter. Just more a little patient.

 

As kent1cooper's comment, he understood what I want to do. And it is just difficult when must to detect dim's ext line overlap with various object as polyline, part of blocks or something. I also realize that, so my drawing have no any blocks, and I will explode polyline to lines.

If you can, please read my comment to kent1cooper, I wrote my idea clearly and I think it can be done by lisp or Visual LISP. Actually this routine is same with detect and remove overlapped line to line (like Autodesk's overkill command) which Lee-Mac coded before. But this time is overlaps of dim's ext line to lines object.
I just understand clearly how to control XYZ, AlignDimension and work well with loops. I think it can be solved.

 

Below image is what I need to do in LISP. Thank for your time when read and help me.
LISP.jpg

0 Likes

Anonymous
Not applicable

@hak_vz Thank you so so much for helping.

 

About sample drawing, I posted and explained in first post, I will post again here.

- Please download attached [Sample_Remove Overlap Ext Line.dwg]
- I also post the lisp to move all selected dimension 's ext line point reset to dim's base line. (by Roy_043 cadtutor.net) please refer the lisp to save your time.

 

***About idea to fix exactly what I need to do. Please read my idea below first to save our time.

- Now I have a function to move all def points of dimensions (dxf 13, 14) to base line (dxf 10) working well. (From Roy_043 cadtutor forum)

- Because I just need to detect overlaps of dimensions and lines (no part of block or something, I will explode polyline to detect overlap easier)

- So, my idea: I will make a small ssget cross selection (maybe 2mm square) at 2 of ext line point (dxf 14) and def point (dxf 10) to select all lines which are overlapping with dimensions.

- When I have a set of line and one of ext line XYZ informations. I will make some maths to know what position of dim points compare with line end points.

- Then I make an action to move def point after I knew the relation of them.


Regards,