Hi @Moshe-A almost there! Thank you so much!
I have attached the result of the HLPL command and as you can see marked in yellow are several instances in which the middle center point of the text is withing the polyline yet it changes it to red color.
It also grabs the ones I need to fix but if there is a way to only mark the ones where the mc of the text is out it would be awesome!
PD: Can this be restricted to a polyline in layer:
@vporrash141089 wrote:
Sorry I should have been clearer, in the example there are a couple of text not inside a polyline... I probably should have said that polylines without text mc inside should be the least in the file.
When you see the file I attached you assume it is correct, however like I said there are a couple I have identified and should move manually after the fact.
Meaning what I want the tool to do is change the color of the polylines that do not have a text justified to the middle center in them and so I can identify them faster, that is all.
Let's say you were doing what I'm doing you said it is good, but it isn't so wouldn't it be easier to run a tool that tells you right away which polyline need fixing? 🙂
I appreciate you looking into this so much!
@Moshe-A I've added another drawing with what i imagine the highlight would be like
; highlight polyline
(defun c:hlpl (/ ss)
; return pline points
(defun vertices (ent)
(vl-remove-if
'not
(mapcar
'(lambda (itm)
(if (= (car itm) 10)
(cdr itm)
)
); lambda
(entget ent)
); mapcar
); vl-remove-if
); vertices
; here start c:hlpl
(setvar "cmdecho" 0)
(command "._undo" "_begin")
(if (setq ss (ssget '((0 . "*polyline")(8 . "SPACE"))))
(foreach ename (vl-remove-if 'listp (mapcar 'cadr (ssnamex ss)))
(if (not (ssget "_wp" (vertices ename) '((0 . "text"))))
(command "._chprop" "_si" ename "_properties" "_color" "1" "")
)
); foreach
); if
(command "._undo" "_end")
(setvar "cmdecho" 1)
(princ)
); c:hlpl
Attached another example where it selects multiple "Correct" Polylines
Thank you!