AutoLISP function to move selected text to them nearest point or vertex where the text is not intersected by a single line

AutoLISP function to move selected text to them nearest point or vertex where the text is not intersected by a single line

nemanja.kantar
Observer Observer
801 Views
6 Replies
Message 1 of 7

AutoLISP function to move selected text to them nearest point or vertex where the text is not intersected by a single line

nemanja.kantar
Observer
Observer

Hi, is it possible to create this LISP function, it's a bit complicated for me to explain this.
In this case, numbers should be selected and moved to the nearest point or vertex, and when moved, the text should not intersect any lines or polygons. Moving isn't that much of a problem, but the latter is.

My idea is to create a rectangle around the text using the TCIRCLE function and then move the rectangle along the edge of the circle (where the center of the circle is the moving point) of some radius until it is not intersected by lines, if there is no such place then the radius increases by some value, it doesn't matter which one.

Anyway, maybe I'm asking to much let me know guys if you have a suggestion. 

THANKS

0 Likes
802 Views
6 Replies
Replies (6)
Message 2 of 7

pbejse
Mentor
Mentor

Will there be any objects outside the polygon? so i take it the best location is inside? 

0 Likes
Message 3 of 7

nemanja.kantar
Observer
Observer

Yes, there will be lines and polylines that connect back to those points. In this case from screenshot, every point have two lines that text must avoid. It would be ideal if he would place it in the first place that is available to him in terms of width, for example a meter from the point.

Something like this...

0 Likes
Message 4 of 7

Sea-Haven
Mentor
Mentor

Also posted here https://www.cadtutor.net/forum/topic/88192-autolisp-functio-to-move-selected-text-to-them-nearest-po...

 

I can see a problem with point 15 may need a moved point to far away so try outside rather than in. 

0 Likes
Message 5 of 7

pbejse
Mentor
Mentor

@Sea-Haven wrote:

I can see a problem with point 15 may need a moved point to far away so try outside rather than in. 


Thats true

 

@nemanja.kantar 

At point 17, there appears to be  3 closed polygons intersecting at the same point, can you confirm that these are closed polylines?

 

0 Likes
Message 6 of 7

nemanja.kantar
Observer
Observer

Yes, i think that doesn’t matter are they closed polygons. It may be lines too… 

For point 15 i move manualy.

0 Likes
Message 7 of 7

Sea-Haven
Mentor
Mentor

If have lines & Plines making shape then need to select inside the shape and use Bpoly to make a new pline for the text searching, working on something.

0 Likes