63
242
181
后起之秀
使用道具 举报
18
434
422
初露锋芒
(defun c:textalign() (setq line (car (entsel "Pick a line")) text (car (entsel "...and a text")) ang (angle (cdr (assoc 10 (entget line))) (cdr (assoc 11 (entget line))) ) tl (entget text) tl (subst (cons 50 ang) (assoc 50 tl) tl) tl (entmod tl) ) (progn) )
2
439
536
限制会员
(defun c:talong(/ actDoc actSp cText curAng curDer curPar curStr curTxt lChr oldMode oldOff oldSize oldSnap pt1 pt2 rLst selObj selPt stFlag tmpLn tStr txTpt unStart whatDo) (vl-load-com) (defun asmi_EntselWithOptions(Message / grLst filPt selSet) (if Message (princ Message) (princ "\nSelect object: ") ); end if (setq lChr "" grLst(list 2 678) tStr "" ); end setq (while (and (not (member lChr '(" " "\r"))) (/= 3(car grLst)) ); end or (if (setq grLst(grread nil 4 2)) (progn (cond ((= 3(car grLst)) (setq filPt(cadr grLst) selSet(ssget filPt) ); end setq (if selSet (setq outVal (list(ssname selSet 0)filPt)) ); end if ); end cond #1 ((= 2(car grLst)) (setq lChr(chr(cadr grLst))) (if (not (member lChr '(" " "\r"))) (progn (setq tStr(strcat tStr lChr) outVal tStr); end setq (princ lChr) ); end progn ); end if ); end cond #2 ); end cond ); end progn ); end if ); end while outVal ); end of asmi_EntselWithOptions (defun asmi_LayersUnlock(/ restLst) (setq restLst '()) (vlax-for lay (vla-get-Layers (vla-get-ActiveDocument (vlax-get-acad-object))) (setq restLst (append restLst (list (list lay (vla-get-Lock lay) (vla-get-Freeze lay) ); end list ); end list ); end append ); end setq (vla-put-Lock lay :vlax-false) (if (vl-catch-all-error-p(vl-catch-all-apply 'vla-put-Freeze(list lay :vlax-false))) t) ); end vlax-for restLst ); end of asmi_LayersUnlock (defun asmi_LayersStateRestore(StateList) (foreach lay StateList (vla-put-Lock(car lay)(cadr lay)) (if (vl-catch-all-error-p(vl-catch-all-apply 'vla-put-Freeze(list(car lay)(nth 2 lay)))) t) ); end foreach (princ) ); end of asmi_LayersStateRestore ;;===========================================================;; UNFORMAT.LSP (c)2003, John F. Uhden, Cadlantic/CADvantage;; v1.0 (04-01-03);; Removes MTEXT formatting with option to retain the "\\P" LineFeeds;;;; Arguments:;; Mtext - either an Ename or VLA-Object;; KeepLF - nil (discard LineFeeds) non-nil (retain LineFeeds);;;; NOTES:;; Only R15 or higher.;; v1.0 is only the first attempt.;; We can always embellish the code with additional options.;; Yes, it can probably be sped up using integers, but this is legible.;;(defun UnFormat (Mtext KeepLF / Text Str)(vl-load-com) (cond ((= (type Mtext) 'VLA-Object)); end condition #1 ((= (type Mtext) 'ENAME) (setq Mtext (vlax-ename->vla-object Mtext)) ); end condition #2 (1 (setq Mtext nil)) ; end condition #3 ); end cond (and