Determining if an object is outside the display area

Determining if an object is outside the display area

saitoib
Advocate Advocate
1,171 Views
4 Replies
Message 1 of 5

Determining if an object is outside the display area

saitoib
Advocate
Advocate

Hi all

In AutoCAD, it seems that the trimming of shapes does not work well in areas that are not displayed on the display.

The solution is to zoom out on the object and display it on the screen before trimming.

 

However, in this case, is it possible to determine if the target object is outside the display range?

 

Or, is there another way to trim outside the display range other than displaying the entire image?

 

Thank you.

Saitoib
0 Likes
Accepted solutions (1)
1,172 Views
4 Replies
Replies (4)
Message 2 of 5

Sea-Haven
Mentor
Mentor

Its an old problem not finding objects one way is ZOOM C PT Scale so zoom in on the area of interest.

0 Likes
Message 3 of 5

Kent1Cooper
Consultant
Consultant

@saitoib wrote:

.... is it possible to determine if the target object is outside the display range? ....


In many cases, yes.  You could determine the corners of the display range as in your other topic, and get the bounding box of the target object.  If any of the coordinates of that bounding box are smaller than those of the lower left corner of the viewing area, or greater than those of the upper right corner, then the object extends past the viewing area in some direction.  If all of the bounding box's X coordinates are smaller than the viewing area's left side, or greater than its right side, or similarly with Y coordinates all below the bottom or above the top, then the object lies entirely outside the display range.

 

BUT that approach can be thrown off by some objects.  Splines often have a bounding box that is larger than their visible extent, and Mtext's bounding box is as wide as its defining box width even if its text content doesn't fill that width, and a Block at a rotation other than zero has a bounding box as if the bounding box of its zero-rotation content was a drawn rectangle, rotated along with it.  And a diagonal Line, or an Arc, or a Polyline of certain configuration, etc., could be fully outside the display range but its bounding box could reach inside it.  So it depends on the nature of the objects that would be involved.

Kent Cooper, AIA
0 Likes
Message 4 of 5

ParishSouthBdx
Collaborator
Collaborator

could you not just move the object a certain "X" distance, bringing it fully into the display area, do what needs to be done and afterwards move it back that certain "X"  distance?  wouldn't the use of limits prevent the placement of objects outside a set boundary or LIMITS?

0 Likes
Message 5 of 5

saitoib
Advocate
Advocate
Accepted solution

Thank you all for your valuable advice.

 

I came up with this from the advice you gave me.
This time

 

(setvar "cmdecho" 0)
(command "zoom" "o" ent1 "")
            .
   operaton
        .
(command "zoom" "p")
(setvar "cmdecho" 1)

I was able to solve the problem with the above method.

 

Thank you .

Saitoib
0 Likes