mhupp Posted November 23, 2021 Posted November 23, 2021 @ronjonp correct me if am wrong. Build a selection set set a mini distance for t depending on layer separate the selection set into 2 lists one with the point and text other with the point and entity Sort each list by first elements x cord smallest to largest. while their is a elements in list a compare the first element to each element in list b stop if distance is less then 1.5 & change the text and remove it from list b. (works left to right in drawing because of sort) (usually only have to compare 1-5 items before meeting distance statement instead of checking whole list) if nothing is withing 1.5 distance make a circle around text point on nomatch layer. Quote
ronjonp Posted November 23, 2021 Posted November 23, 2021 (edited) 2 hours ago, mhupp said: @ronjonp correct me if am wrong. Build a selection set set a mini distance for t depending on layer separate the selection set into 2 lists one with the point and text other with the point and entity Sort each list by first elements x cord smallest to largest. while their is a elements in list a compare the first element to each element in list b stop if distance is less then 1.5 & change the text and remove it from list b. (works left to right in drawing because of sort) (usually only have to compare 1-5 items before meeting distance statement instead of checking whole list) if nothing is withing 1.5 distance make a circle around text point on nomatch layer. Spot on ... the speed boost comes from the pre-sorted x values and vl-some stepping out when it finds a match (which should be closer to the front of the list). Edited November 23, 2021 by ronjonp Quote
mhupp Posted November 23, 2021 Posted November 23, 2021 Wouldn't it be possible to get the wrong text? like it would pick up cat before dog because its to the left but still within the acceptable distance? Just trying to fig it out the pros and cons. like not to make the check distance too big or you might get errors. Quote
ronjonp Posted November 23, 2021 Posted November 23, 2021 (edited) 10 minutes ago, mhupp said: Wouldn't it be possible to get the wrong text? .... Yes. vl-sort to the closest distance is probably the most reliable. That code was tailored to the sample drawing. Edited November 23, 2021 by ronjonp 1 Quote
BIGAL Posted November 23, 2021 Posted November 23, 2021 Like the ronjonp answer it will depend on tolerance so maybe use the text ht * fuzz factor for the tolerance, I will do the search by polygon method interested as to how fast compared to the distance method. Have to go out now later today hopefully. Quote
Recommended Posts
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.