TheSwamp
Code Red => AutoLISP (Vanilla / Visual) => Topic started by: jtm2020hyo on March 30, 2020, 12:04:49 AM
-
I need to insert a block with ATTRIBUTE( or TEXT, MTEXT, RTEXT, DTEXT) in the middle of the selected lines, but with the field of length, layer, line type, etc. any selected field but of each selected line individually
(https://autodesk.i.lithium.com/t5/image/serverpage/image-id/742806iB3BD83FD6F1E0354/image-size/large?v=1.0&px=999)
related link: https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/modify-mmp-lisp-to-insert-attribute-text-mtext-rtext-dtext/m-p/9385885#M397369
inspired by Lee Mac: http://www.lee-mac.com/midlen.html
(http://www.lee-mac.com/lisp/gifs/midlen.gif)
attached MMP, a lisp very similar to my request and a drawing with my representation.
PD: if possible use DCL.
-
Using a (vlax-curve-getfirstderiv obj (vlax-curve-getparamatpoint you can return the angle at that point so will be tangent to an arc just convert to 90 direction and like Lee check for readability.
So should be able to change lee's code pretty easy.
(defun alg-ang (obj pnt)
(angle '(0. 0. 0.)
(vlax-curve-getfirstderiv
obj
(vlax-curve-getparamatpoint
obj
pnt
)
)
)
)
-
Using a (vlax-curve-getfirstderiv obj (vlax-curve-getparamatpoint you can return the angle at that point so will be tangent to an arc just convert to 90 direction and like Lee check for readability.
So should be able to change lee's code pretty easy.
(defun alg-ang (obj pnt)
(angle '(0. 0. 0.)
(vlax-curve-getfirstderiv
obj
(vlax-curve-getparamatpoint
obj
pnt
)
)
)
)
thanks a lot for your reply. exist any way to insert any type of field related to the polyline? like length, line type, layer, or anything.