Lisphk 发表于 2016-6-18 12:38:42

MTEXT对齐曲线



(vl-load-com)

(setq es    (entsel)
      entpt (osnap (cadr es) "_nea")
      ang   (angle '(0 0 0)
                   (vlax-curve-getFirstDeriv
                     (vlax-ename->vla-object (car es))
                     (vlax-curve-getParamAtPoint
                     (vlax-ename->vla-object (car es))
                     entpt
                     )
                   )
          )
)
(if (and (> ang (/ pi 2)) (<= ang (* pi 1.5)))
(setq ang (+ ang pi))
)
(setq hght (getreal "\nText Height : "))
(setq
mspace (vla-get-modelspace
           (vla-get-activedocument (vlax-get-acad-object))
       )
)

(setq mtextobj (vla-addMText
               mspace
               (vlax-3d-point entpt)
               0.0
               "AUTOCAD"
             )
)
(vla-put-attachmentPoint
mtextobj
acAttachmentPointMiddleCenter
)
(vla-put-insertionPoint mtextobj (vlax-3d-point entpt))
(vla-put-Rotation mtextobj ang)
(vla-put-Height mtextobj hght)
(vla-put-Color mtextobj 7)
(vla-put-backgroundfill mtextobj :vlax-true)












xvjiex 发表于 2021-9-3 06:04:06

感谢楼主分享MTEXT对齐曲线

ynpxqjlb 发表于 2023-1-12 10:25:07

学习一下~~~~~~~

happyending 发表于 4 天前

认真学习学习。感谢分享。
页: [1]
查看完整版本: MTEXT对齐曲线