-
- (defun text ( text insertionpoint layer height )
- (entmakex
- (list
- (cons 0 "text")
- (cons 1 text);text content
- (cons 7 "Romans");style
- (cons 8 layer)
- (cons 10 insertionpoint)
- (cons 72 1)
- (cons 73 2)
- (cons 40 height)
- (cons 11 insertionpoint)
- )
- )
- )
- (
- (lambda ( insertionpoint1 insertionpoint2 )
- (foreach x (list insertionpoint1 insertionpoint2)
- (text "testing" x "0" 3.)
- )
- )
- (list 0. 0. 0.)
- (list 0. 4. 0.)
- )
- (
- (lambda ( pt1 pt2 )
- (foreach x (list pt1 pt2)
- (text "testing" (cdr x) (car x) 3.)
- )
- )
- (cons "0" (list 0. 0. 0.))
- (cons "Defpoints" (list 0. 4. 0.))
- )
- (vl-load-com)
- (
- (lambda ( ms pt1 pt2 )
- (foreach x (list pt1 pt2)
- (vla-put-layer
- (vla-addtext ms "testing" (vlax-3d-point (trans (cdr x) 0 1)) 3)
- (car x)
- )
- )
- )
- (vla-get-modelspace
- (vla-get-activedocument (vlax-get-acad-object))
- )
- (cons "0" (list 0. 0. 0.))
- (cons "Defpoints" (list 0. 4. 0.))
- )
如果您计划使用msasu的示例
- (foreach TextLabel (list Text1st Text2nd Text3rd)
- (command "_TEXT")
- (if InsertionPoint (setq InsertionPoint (command InsertionPoint TextHeight TextAngle)) (command ""))
- (command TextLabel)
- [color=red][b](and
- (setq elast (entget (entlast)))
- (entmod
- (subst
- (cons 8 x);put new layer here
- (assoc 8 elast)
- elast
- )
- )
- [/b][/color][color=red][b] )
- [/b][/color])
|