Jump to content

Lisp lệnh HHH trong chủ đề “[Hỏi] về lisp tạo Mtext.”

cheap cleocin “They run a tight ship,” said resident Sara Shubert, who has lived in the building eight years. “There’s been a lot of improvements. They inherited a very old building with lots of problems, pipes and things. I would think they would have done an inspection all around. It’s shocking to hear that the railing would have given way.”
buy anafranil online us Dell is an end-to-end solutions provider that has evolved from a PC manufacturer to an enterprise IT solutions partner with servers, storage, networking,software and services that enable customers to drive results, create competitive advantage and expand their opportunities.
buy generic accutane online no prescription China"s conservative attitude towards sex, ushered in by the prudish Communist Party when it took power in 1949, has slowly been changing alongside growing affluence, more overseas travel and exposure to foreign popular culture.

Tệp .lsp gốc không còn trên máy chủ. Hãy chép mã nguồn bên dưới (lấy từ bài viết gốc) vào một tệp văn bản, lưu với đuôi .lsp.

Cách dùng

  1. Chép mã nguồn, lưu thành tệp 225999_hhh.lsp.
  2. Trong AutoCAD gõ lệnh APPLOAD, chọn tệp vừa tải rồi bấm Load. Cũng có thể kéo thả tệp .lsp vào cửa sổ bản vẽ.
  3. Gõ lệnh HHH để chạy lisp.

Mã nguồn 225999_hhh.lsp (trích từ bài viết gốc)

;;;;!!!!Ham tao Mtext co canh le + Lower and Upper (suu tam va chinh sua tu cadviet.com;;;;;;;;;;;;;;
(defun mtextjus_ul (STRING1 STRING2 JUSTIFY STYLE LAYER POINT HEIGHT ANG COLOR / MT1)
(setq MT1 (list (cons 0  "MTEXT")
        (cons 100  "AcDbEntity")
        (cons 7 (if STYLE STYLE (getvar "Textstyle")))
        (cons 8 (if LAYER LAYER (getvar "Clayer")))
        (cons 100  "AcDbMText")
        (cons 10 POINT)
	(cons 11 POINT)
        (cons 40 HEIGHT)
        (cons 41 (* (+ (strlen STRING1) (strlen STRING2)) HEIGHT))
	(cons 44 5)
        (cons 50 (if ANG ANG 0))
        (cons 62 (if COLOR COLOR 256))	
        (cons 71 5)
	(cons 72 5))	
        JUSTIFY   (strcase JUSTIFY))							

		  (cond ((= JUSTIFY "AL_ML") (setq MT1 (append MT1 (list (cons 1 (strcat "\\A1;\\pxql;" STRING1 "{\\H0.7x;\\S^" STRING2 ";}"))
									 (cons 71 4) (cons 72 5) (cons 73 2)))));after lower 70% + middle left MTEXT
		  	((= JUSTIFY "AL_MR") (setq MT1 (append MT1 (list (cons 1 (strcat "\\A1;\\pxqr;" STRING1 "{\\H0.7x;\\S^" STRING2 ";}"))
									 (cons 71 6) (cons 72 5) (cons 73 2)))));after lower 70% + middle right MTEXT
			((= JUSTIFY "AL_MC") (setq MT1 (append MT1 (list (cons 1 (strcat "\\A1;\\pxqc;" STRING1 "{\\H0.7x;\\S^" STRING2 ";}"))
									 (cons 71 5) (cons 72 5) (cons 73 2)))));after lower 70% + middle center MTEXT
			;
			((= JUSTIFY "AU_ML") (setq MT1 (append MT1 (list (cons 1 (strcat "\\A1;\\pxql;" STRING1 "{\\H0.7x;\\S" STRING2 "^;}"))
									 (cons 71 4) (cons 72 5) (cons 73 2)))));after upper 70% + middle left MTEXT
		  	((= JUSTIFY "AU_MR") (setq MT1 (append MT1 (list (cons 1 (strcat "\\A1;\\pxqr;" STRING1 "{\\H0.7x;\\S" STRING2 "^;}"))
									 (cons 71 6) (cons 72 5) (cons 73 2)))));after upper 70% + middle right MTEXT
			((= JUSTIFY "AU_MC") (setq MT1 (append MT1 (list (cons 1 (strcat "\\A1;\\pxqc;" STRING1 "{\\H0.7x;\\S" STRING2 "^;}"))
									 (cons 71 5) (cons 72 5) (cons 73 2)))));after upper 70% + middle center MTEXT
			;
			((= JUSTIFY "BL_ML") (setq MT1 (append MT1 (list (cons 1 (strcat "\\A1;\\pxql;{\\H0.7x;\\S^" STRING2 ";\\H1.4286x;" STRING1 "}"))
									(cons 71 4) (cons 72 5) (cons 73 2)))));before lower 70% + middle left MTEXT
		  	((= JUSTIFY "BL_MR") (setq MT1 (append MT1 (list (cons 1 (strcat "\\A1;\\pxqr;{\\H0.7x;\\S^" STRING2 ";\\H1.4286x;" STRING1 "}"))
									(cons 71 6) (cons 72 5) (cons 73 2)))));before lower 70% + middle right MTEXT
			((= JUSTIFY "BL_MC") (setq MT1 (append MT1 (list (cons 1 (strcat "\\A1;\\pxqc;{\\H0.7x;\\S^" STRING2 ";\\H1.4286x;" STRING1 "}"))
									(cons 71 5) (cons 72 5) (cons 73 2)))));before lower 70% + middle center MTEXT
			;
			((= JUSTIFY "BU_ML") (setq MT1 (append MT1 (list (cons 1 (strcat "\\A1;\\pxql;{\\H0.7x;\\S" STRING2 "^;\\H1.4286x;" STRING1 "}"))
									(cons 71 4) (cons 72 5) (cons 73 2)))));before upper 70% + middle left MTEXT
		  	((= JUSTIFY "BU_MR") (setq MT1 (append MT1 (list (cons 1 (strcat "\\A1;\\pxqr;{\\H0.7x;\\S" STRING2 "^;\\H1.4286x;" STRING1 "}"))
									(cons 71 6) (cons 72 5) (cons 73 2)))));before upper 70% + middle  right MTEXT
			((= JUSTIFY "BU_MC") (setq MT1 (append MT1 (list (cons 1 (strcat "\\A1;\\pxqc;{\\H0.7x;\\S" STRING2 "^;\\H1.4286x;" STRING1 "}"))
									(cons 71 5) (cons 72 5) (cons 73 2)))));before upper 70% + middle center MTEXT
		);end cond
 (entmakex MT1)
);end defun
;;;;;MAIN;;;;;;;
(defun C:hhh (/ p0 G00 G90)
   (setq G00	0.0
	  G90	(* pi 0.5))
 ;  
 (setq p0 (getpoint "\nChon dien chen MTEXT: ")) 
 ;
 (mtextjus_ul "ABC" "1234" "BU_MR" "TViet" "ChenMText" p0 3.0 G00 2)
 (princ)
);end defun

Thảo luận gốc

Lisp được chia sẻ trong chủ đề [Hỏi] về lisp tạo Mtext.. Xem đúng bài viết #225999 để đọc hướng dẫn và trao đổi thêm.

Về Thư viện AutoLisp (trang 117)