Jump to content

# Find the wrong dimensions (pick on error point)

## Recommended Posts

The quick answers of some "gurus" of the forum excited me ... indeed "galvanized", so I decided to submit you a lisp that I made years ago, but that I have never used because it is too unreliable in the results.

THE PROBLEM

For some time I have been thinking of a lisp that would allow me to verify the correctness of the dimensions. In particular I wanted to understand if there was a way to check if a dimension has its own base point (DXF codes 13 and 14) to an entity or if, for various reasons, it indicates a point in the void of the drawing.

The typical case is what you see in PICTURE 1: I draw a rectangle 400 x 200 and the dimension.

Then using the GRIPs, I stretch vertex B: PICTURE 2. The dimensions continue to indicate the maximum dimensions of the figure but are no longer on the end of the lines. The size is from A to B .. which horizontally is like point C, so that's ok too.
I know that if the size had been "ASSOCIATIVE" it would have come after me even by moving the grip ... but the membership fees give me hives and I never use them!

In PICTURE 3, I STRETCH a part of the drawing, without including in this operation the "base" point (DXF 13 or 14) of the dimensions (I include point C but not point B) ... so from this moment the horizontal dimension is wrong (while the vertical one is still correct, having ironed horizontally).

I know that this last operation is wrong and should never be done ... but it actually happens.
So basically I wanted to create a lisp that not only tells me that PICTURE 1 is correct (this is quite evident), but that PICTURE 2 is correct as well, as by prolonging the "base point" (point B) of the dimension, we reach however a vertex of the figure: PICTURE 2A

On the other hand, PICTURE 3 is wrong and the lisp must highlight this for me, as by extending the base point downwards ... no vertex is found: PICTURE 3A

THE SOLUTION

As I have already mentioned, the solution I found is to use the extensions of the dimensions: therefore it is necessary to scroll one by one the selected dimensions with a window (red rectangle made by the lisp), draw a line that goes from the left positioning point to the left base, then extend this line and see if it touches the end of a line, a midpoint etc .; then do the same with the right (which in this example is the error zone).

In my lisp I wanted not to stop at the first attempt: it is possible that the correct vertex is not the first entity that the extended line encounters; so the line is extended again several times ... until it meets the rectangle created by making the selection window. Then it still doesn't give up and extends the line in the other direction, until you find the bounding box on the opposite side.
At this point, if it has not found a valid hook point, it signals the error with a circle.

MISTAKES

This lisp is far from perfect: using osnaps to find points is subject to the approximations of this method. For example, it is better to analyze a drawing, making rather small selection windows, which analyze limited portions of the drawing. This, not because a greater number of heights exponentially raise the calculations to be done, but because with a window that is too large it is possible that the osnap also hooks incorrect entities, considering them valid, because they are incorrect by a few cm.

Again due to the osnap, I couldn't use all the ways I wanted: I only used END (end of line), MID (midpoint), QUA (Quadrant). The intersection (which would have been indispensable), I could not use: it gave me wrong results, but also the center of a circle, as I would have to "click" with the osnap on the circumference to then check the center.
From this it is clear that this lisp has HUGE possibilities for improvement and for this reason I am submitting it to you "Command experts VL -...".

In the attached dwg I put the various PICTURES: by launching the lisp try to frame PICTURE 1 then 2 then 3 ... only PICTURE 3 will mark with 2 circles that the wrong quote.

Maybe someone on the forum has some idea that allows you to verify the entities, through the analysis of the database and not going through this rough method ...

## Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
×
• Create New...