Author Topic: Insert block with attribute in middle of line with field value.  (Read 1364 times)

0 Members and 1 Guest are viewing this topic.

jtm2020hyo

  • Newt
  • Posts: 198
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



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



attached MMP, a lisp very similar to my request and a drawing with my representation.

PD: if possible use DCL.

BIGAL

  • Swamp Rat
  • Posts: 1396
  • 40 + years of using Autocad
Re: Insert block with attribute in middle of line with field value.
« Reply #1 on: March 30, 2020, 02:54:37 AM »
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.

Code: [Select]
(defun alg-ang (obj pnt)
  (angle '(0. 0. 0.)
     (vlax-curve-getfirstderiv
       obj
       (vlax-curve-getparamatpoint
         obj
         pnt
       )
     )
  )
)
A man who never made a mistake never made anything

jtm2020hyo

  • Newt
  • Posts: 198
Re: Insert block with attribute in middle of line with field value.
« Reply #2 on: March 30, 2020, 01:59:19 PM »
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.

Code: [Select]
(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.