Coming back to this quickly, if the OP has a 'U' shaped polyline, with 2 or more filleted corners just selecting the polyline isn't going give the required apex ?
I read the question wrong last night and what I posted above isn't quite what is needed, I'll look at this later
Agreed. Not sure why anyone in this day and age would not use paperspace .. unless still using a 3rd party app created in the mid 80's. Even then you could create layouts to print.
Rather then doing stupid math why not just make a copy then fillet with radius 0.
(setq poly (vlax-invoke (vlax-ename->vla-object ent) 'copy))
(setvar 'filletrad 0)
(vl-cmdf "_.Fillet" "P" (entlast))
Then its just 1+2 & 1+2+3
--EDIT
Then delete poly when done
Ah sorry didn't see that. Another tip for osmode. You can add non right before the point and it wont snap to anything. Like the temp override snap when you shift right click. Don't ask me why/how but even with osmode set to 0 if your zoomed out enough and using command with points. stuff will still snap to entity's so its always good to use "_non". This is one of the reasons why I try to limit the use of command.
Its also good to wrap selections with if. because if the user doesn't select anything no point in running the rest of the code and it could error also.
; error : bad argument type <NIL> ; expected SELECTIONSET at [sslength]
(if (setq ss (ssget '((0 . "TEXT,INSERT") (8 . "CAO DO")))) ; only need to use cons when using variables
(repeat (setq x (sslength ss))
(setq ent (ssname ss (setq x (- x 1))))
(cond ;like if but better see below
((eq (setq itm (cdr (assoc 0 (setq txt (entget ent))))) "TEXT") ;setq txt so you dont need to run entget 4 other times
(setq ins (cdr (assoc 11 txt))) ;this depends on the text justification see below
(setq val (cdr (assoc 1 txt)))
(setq pnt (list (car ins) (cadr ins) (atof val)))
(command "-INSERT" "donut" "_non" pnt 0.0002 0.0002 0)
(entmod (subst (cons 10 pnt) (assoc 10 txt) txt)) ;use pnt aswell
)
((eq "INSERT" itm)
(entdel ent)
)
)
)
(prompt "\nNothing Selected")
)
Check to see if right insertion point is used
(if (eq (cdr (assoc 10 txt)) '(0.0 0.0 0.0))
(setq ins (cdr (assoc 11 txt)))
(setq ins (cdr (assoc 10 txt)))
)
Cond Guide Self taught here as well. just keep at it and stuff will start to make more and more sense. From what I have seen your way ahead of me when I started out.