很快就被砍掉了,把这个放到你的阿卡多克里。lsp账单:
- (defun c:RefDWG ( / str pos hgt ) (vl-load-com)
- (setq str "REFERENCE DRAWING" ;; Text String
- pos '(0.5 2.0 0.0) ;; Text Position
- hgt 0.25 ;; Text Height
- )
- (vla-AddText
- (vla-get-PaperSpace
- (vla-get-ActiveDocument
- (vlax-get-acad-object)
- )
- )
- str (vlax-3D-point pos) hgt
- )
- (princ)
- )
- (c:RefDWG)
或更稳健地考虑当前锁定层:
- (defun c:RefDWG ( / str pos hgt ) (vl-load-com)
- (setq str "REFERENCE DRAWING" ;; Text String
- pos '(0.5 2.0 0.0) ;; Text Position
- hgt 0.25 ;; Text Height
- )
- (if
- (vl-catch-all-error-p
- (vl-catch-all-apply 'vla-AddText
- (list
- (vla-get-PaperSpace
- (vla-get-ActiveDocument
- (vlax-get-acad-object)
- )
- )
- str (vlax-3D-point pos) hgt
- )
- )
- )
- (princ (strcat "\n** Error Creating Text: " str " **"))
- )
- (princ)
- )
- (c:RefDWG)
|