![](https://www.cadviet.com/forum/uploads/set_resources_1/84c1e40ea0e759e3f1505eb1788ddf3c_pattern.png)
![](https://www.cadviet.com/forum/uploads/monthly_2017_09/V.png.3c24796dbaf29c8022deea3b43f0ccaa.png)
vanhuyou
-
Số lượng nội dung
86 -
Đã tham gia
-
Lần ghé thăm cuối
-
Ngày trúng
3
Bài đăng được đăng bởi vanhuyou
-
-
11 giờ trước, ketxu đã nói:Ko biết sai chổ nào mà vẫn ko được, bác xem giúp em file gửi lên với
-
-
1 giờ} trướ}c, Doan Nguyen Van đã nói:Bạn đặt lại là ROUND((15.3)/1)*1 nhé
Cám ơn bạn, mình làm đc rồi
-
Chào các bác, em có tự tạo block động chứa att để vẽ thép sàn, em dùng hàm round để làm tròn như trong excel, ví dụ: 15.6 -> 17, 15.3 -> 15, công thức như trong hình như vậy đã đúng chưa, các bác xem giúp em với.
-
Hỏi về hàm lisp
trong AutoLisp
Vào lúc 12/7/2021 tại 10:21, phucquangcda đã nói:bạn thêm hàm này vào
(defun wtxt(txt p cao)
(entmake (list (cons 0 "TEXT")
(cons 10 p)
(cons 11 p)
(cons 1 txt)
(cons 40 cao)
(cons 72 1)
(cons 73 2)))
)Rồi thay dòng đó bằng dòng này coi: (wtxt (rtos LV 2 3) point 100)
ps: Không nhầm thì bác đang sửa lisp chèn cao độ vào đỉnh pline khi đã biết cao độ điểm đầu và độ dốc pllev trên diễn đàn.
Đúng là chèn cao độ bác, đoạn thêm vào đó đưa vào cuối của lệnh đúng ko bác
-
1
-
-
Hỏi về hàm lisp
trong AutoLisp
16 giờ trước, phucquangcda đã nói:(command "TEXT" "j" "MC" Point 100 "" (rtos NewLV 2 3) "")
Không được bác nó, lệnh trở thành xuất ra text với chiều cao 100, nội dung mình nhập vào
-
Hỏi về hàm lisp
trong AutoLisp
Các bác cho em hỏi là với code như vậy (command "TEXT" "j" "MC" Point "" "" (rtos NewLV 2 3) "") thì khi em muốn chỉnh chiều cao text ví dụ là 100 thì sửa như thế nào vậy, em mới bắt đầu tìm hiểu về lisp, cám ơn các bác
-
1
-
-
Các bác cho em hỏi là em muốn điều chỉnh chiều cao text thì sửa ở đoạn nào v
-
2
-
-
Vào lúc 6/7/2021 tại 07:39, DungNguyen685 đã nói:;;----------------------=={ Length at Midpoint }==----------------------;; ; ;; ; This program prompts the user for a selection of objects to be ;; ; labelled and proceeds to generate an MText object located at ;; ; the midpoint of each object displaying a Field Expression ;; ; referencing the length of the object. ;; ; ;; ; The program is compatible for use with Arcs, Circles, Lines, ;; ; LWPolylines, 2D & 3D Polylines, and under all UCS & View settings. ;; ; ;; ; The program will generate MText objects positioned directly over ;; ; the midpoint of each object, and aligned with the object whilst ;; ; preserving text readability. The MText will have a background mask ;; ; enabled and will use the active Text Style and Text Height settings ;; ; at the time of running the program. ;; ;----------------------------------------------------------------------;; ; Author: Lee Mac, Copyright © 2013 - www.lee-mac.com ;; ;----------------------------------------------------------------------;; ; Version 1.0 - 2013-11-12 ;; ; ;; ; - First release. ;; ;----------------------------------------------------------------------;; ; Version 1.1 - 2016-01-16 ;; ; ;; ; - Modified LM:objectid function to account for 64-bit AutoCAD 2008. ;; ;----------------------------------------------------------------------;; (defun c:midlen ( / *error* ent fmt idx ins ocs par sel spc txt typ uxa ) (setq fmt "%lu6") ;; Field Formatting (setq pr "%pr0") ;; Precision (setq ps "%ps[,0]") ;; (setq ct "%ct8[0.1]") ;; (setq sca1 (getvar "DIMTXT")) (setq sca2 (getvar "DIMSCALE")) (setq sca3 (* sca1 sca2)) (setvar "textsize" sca3) (defun *error* ( msg ) (LM:endundo (LM:acdoc)) (if (not (wcmatch (strcase msg t) "*break,*cancel*,*exit*")) (princ (strcat "\nError: " msg)) ) (princ) ) (if (setq sel (ssget (list '(0 . "ARC,CIRCLE,LINE,*POLYLINE") '(-4 . "<NOT") '(-4 . "<AND") '(0 . "POLYLINE") '(-4 . "&") '(70 . 80) '(-4 . "AND>") '(-4 . "NOT>") (if (= 1 (getvar 'cvport)) (cons 410 (getvar 'ctab)) '(410 . "Model") ) ) ) ) (progn (setq spc (vlax-get-property (LM:acdoc) (if (= 1 (getvar 'cvport)) 'paperspace 'modelspace ) ) ) (setq ocs (trans '(0.0 0.0 1.0) 1 0 t) uxa (angle '(0.0 0.0) (trans (getvar 'ucsxdir) 0 ocs t)) ) (LM:startundo (LM:acdoc)) (repeat (setq idx (sslength sel)) (setq ent (ssname sel (setq idx (1- idx))) par (vlax-curve-getparamatdist ent (/ (vlax-curve-getdistatparam ent (vlax-curve-getendparam ent)) 2.0)) ins (vlax-curve-getpointatparam ent par) typ (cdr (assoc 0 (entget ent))) ) (setq txt (vlax-invoke spc 'addmtext ins 0.0 (strcat "L=" "%<\\AcObjProp Object(%<\\_ObjId " (LM:objectid (vlax-ename->vla-object ent)) ">%)." (cond ( (= "CIRCLE" typ) "Circumference") ( (= "ARC" typ) "ArcLength") ( "Length" ) ) " \\f \" " fmt pr ps ct " \">%" ) ) ) (vla-put-backgroundfill txt :vlax-true) (vla-put-attachmentpoint txt acattachmentpointmiddlecenter) (vla-put-insertionpoint txt (vlax-3D-point ins)) (vla-put-rotation txt (LM:readable (- (angle '(0.0 0.0 0.0) (trans (vlax-curve-getfirstderiv ent par) 0 ocs t)) uxa))) ) (LM:endundo (LM:acdoc)) ) ) (princ) ) ;; Readable - Lee Mac ; Returns an angle corrected for text readability. (defun LM:readable ( a ) ( (lambda ( a ) (if (and (< (* pi 0.5) a) (<= a (* pi 1.5))) (LM:readable (+ a pi)) a ) ) (rem (+ a pi pi) (+ pi pi)) ) ) ;; ObjectID - Lee Mac ; Returns a string containing the ObjectID of a supplied VLA-Object ; Compatible with 32-bit & 64-bit systems (defun LM:objectid ( obj ) (eval (list 'defun 'LM:objectid '( obj ) (if (wcmatch (getenv "PROCESSOR_ARCHITECTURE") "*64*") (if (vlax-method-applicable-p (vla-get-utility (LM:acdoc)) 'getobjectidstring) (list 'vla-getobjectidstring (vla-get-utility (LM:acdoc)) 'obj ':vlax-false) '(LM:ename->objectid (vlax-vla-object->ename obj)) ) '(itoa (vla-get-objectid obj)) ) ) ) (LM:objectid obj) ) ;; Entity Name to ObjectID - Lee Mac ; Returns the 32-bit or 64-bit ObjectID for a supplied entity name (defun LM:ename->objectid ( ent ) (LM:hex->decstr (setq ent (vl-string-right-trim ">" (vl-prin1-to-string ent)) ent (substr ent (+ (vl-string-position 58 ent) 3)) ) ) ) ;; Hex to Decimal String - Lee Mac ; Returns the decimal representation of a supplied hexadecimal string (defun LM:hex->decstr ( hex / foo bar ) (defun foo ( lst rtn ) (if lst (foo (cdr lst) (bar (- (car lst) (if (< 57 (car lst)) 55 48)) rtn)) (apply 'strcat (mapcar 'itoa (reverse rtn))) ) ) (defun bar ( int lst ) (if lst (if (or (< 0 (setq int (+ (* 16 (car lst)) int))) (cdr lst)) (cons (rem int 10) (bar (/ int 10) (cdr lst))) ) (bar int '(0)) ) ) (foo (vl-string->list (strcase hex)) nil) ) ;; Start Undo - Lee Mac ; Opens an Undo Group. (defun LM:startundo ( doc ) (LM:endundo doc) (vla-startundomark doc) ) ;; End Undo - Lee Mac ; Closes an Undo Group. (defun LM:endundo ( doc ) (while (= 8 (logand 8 (getvar 'undoctl))) (vla-endundomark doc) ) ) ;; Active Document - Lee Mac ; Returns the VLA Active Document Object (defun LM:acdoc nil (eval (list 'defun 'LM:acdoc 'nil (vla-get-activedocument (vlax-get-acad-object)))) (LM:acdoc) ) (vl-load-com) (princ (strcat "\n:: MidLen.lsp | Version 1.1 | \\U+00A9 Lee Mac " (menucmd "m=$(edtime,0,yyyy)") " www.lee-mac.com ::" "\n:: Type \"midlen\" to Invoke ::" ) ) (princ) ;;----------------------------------------------------------------------;; ; End of File ;; ;----------------------------------------------------------------------;;
test xem nhé!
Các bác cho em hỏi thêm là khi em dùng lệnh tcout để đánh số thì cái mtext không áp dụng được, phải explode nó ra mới được
-
Vào lúc 4/7/2021 tại 21:58, thiep đã nói:Ơ, đã giúp rồi còn gì? Bạn chạy trên autoCad đời nào? Bạn đã chạy lisp và kết quả như thế nào? chụp hình gửi lên xem?
Cám ơn bác đã đúng ý của em rồi
-
17 giờ trước, DungNguyen685 đã nói:;;----------------------=={ Length at Midpoint }==----------------------;; ; ;; ; This program prompts the user for a selection of objects to be ;; ; labelled and proceeds to generate an MText object located at ;; ; the midpoint of each object displaying a Field Expression ;; ; referencing the length of the object. ;; ; ;; ; The program is compatible for use with Arcs, Circles, Lines, ;; ; LWPolylines, 2D & 3D Polylines, and under all UCS & View settings. ;; ; ;; ; The program will generate MText objects positioned directly over ;; ; the midpoint of each object, and aligned with the object whilst ;; ; preserving text readability. The MText will have a background mask ;; ; enabled and will use the active Text Style and Text Height settings ;; ; at the time of running the program. ;; ;----------------------------------------------------------------------;; ; Author: Lee Mac, Copyright © 2013 - www.lee-mac.com ;; ;----------------------------------------------------------------------;; ; Version 1.0 - 2013-11-12 ;; ; ;; ; - First release. ;; ;----------------------------------------------------------------------;; ; Version 1.1 - 2016-01-16 ;; ; ;; ; - Modified LM:objectid function to account for 64-bit AutoCAD 2008. ;; ;----------------------------------------------------------------------;; (defun c:midlen ( / *error* ent fmt idx ins ocs par sel spc txt typ uxa ) (setq fmt "%lu6") ;; Field Formatting (setq pr "%pr0") ;; Precision (setq sca1 (getvar "DIMTXT")) (setq sca2 (getvar "DIMSCALE")) (setq sca3 (* sca1 sca2)) (setvar "textsize" sca3) (defun *error* ( msg ) (LM:endundo (LM:acdoc)) (if (not (wcmatch (strcase msg t) "*break,*cancel*,*exit*")) (princ (strcat "\nError: " msg)) ) (princ) ) (if (setq sel (ssget (list '(0 . "ARC,CIRCLE,LINE,*POLYLINE") '(-4 . "<NOT") '(-4 . "<AND") '(0 . "POLYLINE") '(-4 . "&") '(70 . 80) '(-4 . "AND>") '(-4 . "NOT>") (if (= 1 (getvar 'cvport)) (cons 410 (getvar 'ctab)) '(410 . "Model") ) ) ) ) (progn (setq spc (vlax-get-property (LM:acdoc) (if (= 1 (getvar 'cvport)) 'paperspace 'modelspace ) ) ) (setq ocs (trans '(0.0 0.0 1.0) 1 0 t) uxa (angle '(0.0 0.0) (trans (getvar 'ucsxdir) 0 ocs t)) ) (LM:startundo (LM:acdoc)) (repeat (setq idx (sslength sel)) (setq ent (ssname sel (setq idx (1- idx))) par (vlax-curve-getparamatdist ent (/ (vlax-curve-getdistatparam ent (vlax-curve-getendparam ent)) 2.0)) ins (vlax-curve-getpointatparam ent par) typ (cdr (assoc 0 (entget ent))) ) (setq txt (vlax-invoke spc 'addmtext ins 0.0 (strcat "L=" "%<\\AcObjProp Object(%<\\_ObjId " (LM:objectid (vlax-ename->vla-object ent)) ">%)." (cond ( (= "CIRCLE" typ) "Circumference") ( (= "ARC" typ) "ArcLength") ( "Length" ) ) " \\f \"" fmt pr "\">%" ) ) ) (vla-put-backgroundfill txt :vlax-true) (vla-put-attachmentpoint txt acattachmentpointmiddlecenter) (vla-put-insertionpoint txt (vlax-3D-point ins)) (vla-put-rotation txt (LM:readable (- (angle '(0.0 0.0 0.0) (trans (vlax-curve-getfirstderiv ent par) 0 ocs t)) uxa))) ) (LM:endundo (LM:acdoc)) ) ) (princ) ) ;; Readable - Lee Mac ; Returns an angle corrected for text readability. (defun LM:readable ( a ) ( (lambda ( a ) (if (and (< (* pi 0.5) a) (<= a (* pi 1.5))) (LM:readable (+ a pi)) a ) ) (rem (+ a pi pi) (+ pi pi)) ) ) ;; ObjectID - Lee Mac ; Returns a string containing the ObjectID of a supplied VLA-Object ; Compatible with 32-bit & 64-bit systems (defun LM:objectid ( obj ) (eval (list 'defun 'LM:objectid '( obj ) (if (wcmatch (getenv "PROCESSOR_ARCHITECTURE") "*64*") (if (vlax-method-applicable-p (vla-get-utility (LM:acdoc)) 'getobjectidstring) (list 'vla-getobjectidstring (vla-get-utility (LM:acdoc)) 'obj ':vlax-false) '(LM:ename->objectid (vlax-vla-object->ename obj)) ) '(itoa (vla-get-objectid obj)) ) ) ) (LM:objectid obj) ) ;; Entity Name to ObjectID - Lee Mac ; Returns the 32-bit or 64-bit ObjectID for a supplied entity name (defun LM:ename->objectid ( ent ) (LM:hex->decstr (setq ent (vl-string-right-trim ">" (vl-prin1-to-string ent)) ent (substr ent (+ (vl-string-position 58 ent) 3)) ) ) ) ;; Hex to Decimal String - Lee Mac ; Returns the decimal representation of a supplied hexadecimal string (defun LM:hex->decstr ( hex / foo bar ) (defun foo ( lst rtn ) (if lst (foo (cdr lst) (bar (- (car lst) (if (< 57 (car lst)) 55 48)) rtn)) (apply 'strcat (mapcar 'itoa (reverse rtn))) ) ) (defun bar ( int lst ) (if lst (if (or (< 0 (setq int (+ (* 16 (car lst)) int))) (cdr lst)) (cons (rem int 10) (bar (/ int 10) (cdr lst))) ) (bar int '(0)) ) ) (foo (vl-string->list (strcase hex)) nil) ) ;; Start Undo - Lee Mac ; Opens an Undo Group. (defun LM:startundo ( doc ) (LM:endundo doc) (vla-startundomark doc) ) ;; End Undo - Lee Mac ; Closes an Undo Group. (defun LM:endundo ( doc ) (while (= 8 (logand 8 (getvar 'undoctl))) (vla-endundomark doc) ) ) ;; Active Document - Lee Mac ; Returns the VLA Active Document Object (defun LM:acdoc nil (eval (list 'defun 'LM:acdoc 'nil (vla-get-activedocument (vlax-get-acad-object)))) (LM:acdoc) ) (vl-load-com) (princ (strcat "\n:: MidLen.lsp | Version 1.1 | \\U+00A9 Lee Mac " (menucmd "m=$(edtime,0,yyyy)") " www.lee-mac.com ::" "\n:: Type \"midlen\" to Invoke ::" ) ) (princ) ;;----------------------------------------------------------------------;; ; End of File ;; ;----------------------------------------------------------------------;;
Mình giúp bạn đến đây nhé! test thử xem.
Bác nào có thể giúp em làm tròn số lên 10 được không, giúp em với.
-
1
-
-
Em xin cám ơn 2 bác
DungNguyen685 và thiep đã giúp đỡ.
49 phút trước, thiep đã nói:Dựa theo lisp MIDLEN.lsp của LEEMAC, Thiep ra lisp LENGFIELD.lsp phù hợp với ý của bạn
Nhớ là cách chọn đối tượng là kiểu Fence nhe bạn, mục đích của mình là đối tượng polyline nào "dính" hàng rào trước thì lisp sẽ tạo ra 1 text gắn field trước, như vậy sẽ pick điểm chèn text cho phù hợp theo trật tự.
;;-------------------=={ Length *POLYLINE _ field }==-------------------;; ; ;; ; This program prompts the user for a selection of objects to be ;; ; labelled and proceeds to generate an MText object located at ;; ; the midpoint of each object displaying a Field Expression ;; ; referencing the length of the object. ;; ; ;; ; The program is compatible for use with *Polylines, and under ;; ; all UCS & View settings. ;; ; The MText will have a background mask ;; ; enabled and will use the active Text Style and Text Height settings ;; ; at the time of running the program. ;; ;----------------------------------------------------------------------;; ; Author: Trân Thiêp base lisp midlen.lsp by Lee Mac, Copyright © 2013 - www.lee-mac.com ;; ;----------------------------------------------------------------------;; ; - Modified LM:objectid function to account for 64-bit AutoCAD 2008. ;; ;----------------------------------------------------------------------;; (defun c:lengfield (/ *error* ent fmt idx ins ocs par sel spc txt typ uxa) (setvar "textsize" (getvar "DIMTXT")) (defun *error* (msg) (LM:endundo (LM:acdoc)) (if (not (wcmatch (strcase msg t) "*break,*cancel*,*exit*")) (princ (strcat "\nError: " msg)) ) (princ) ) (if (setq sel (ssget "F" (acet-ui-fence-select) (list '(0 . "*POLYLINE") '(-4 . "<NOT") '(-4 . "<AND") '(0 . "POLYLINE") '(-4 . "&") '(70 . 80) '(-4 . "AND>") '(-4 . "NOT>") (if (= 1 (getvar 'cvport)) (cons 410 (getvar 'ctab)) '(410 . "Model") ) ) ) ) (progn (setq spc (vlax-get-property (LM:acdoc) (if (= 1 (getvar 'cvport)) 'paperspace 'modelspace ) ) ) (setq ocs (trans '(0.0 0.0 1.0) 1 0 t) uxa (angle '(0.0 0.0) (trans (getvar 'ucsxdir) 0 ocs t)) ) (LM:startundo (LM:acdoc)) (repeat (setq idx (sslength sel)) (setq ent (ssname sel (setq idx (1- idx))) par (vlax-curve-getparamatdist ent (/ (vlax-curve-getdistatparam ent (vlax-curve-getendparam ent)) 2.0) ) ins (vlax-curve-getpointatparam ent par) typ (cdr (assoc 0 (entget ent))) ) (setq txt (vlax-invoke spc 'addmtext ins 0.0 (strcat "L=" "%<\\AcObjProp Object(%<\\_ObjId " (LM:objectid (vlax-ename->vla-object ent)) ">%).Length \\f \"%lu2%pr0%ps[,0]%ct8[0.1]\">%" ) ) ) (vla-put-backgroundfill txt :vlax-true) (vla-put-attachmentpoint txt acattachmentpointmiddlecenter) (vla-put-insertionpoint txt (vlax-3D-point (getpoint "\pick a point for inserttext_field")) ) ) (LM:endundo (LM:acdoc)) ) ) (princ) ) ;; Readable - Lee Mac ; Returns an angle corrected for text readability. (defun LM:readable ( a ) ( (lambda ( a ) (if (and (< (* pi 0.5) a) (<= a (* pi 1.5))) (LM:readable (+ a pi)) a ) ) (rem (+ a pi pi) (+ pi pi)) ) ) ;; ObjectID - Lee Mac ; Returns a string containing the ObjectID of a supplied VLA-Object ; Compatible with 32-bit & 64-bit systems (defun LM:objectid ( obj ) (eval (list 'defun 'LM:objectid '( obj ) (if (wcmatch (getenv "PROCESSOR_ARCHITECTURE") "*64*") (if (vlax-method-applicable-p (vla-get-utility (LM:acdoc)) 'getobjectidstring) (list 'vla-getobjectidstring (vla-get-utility (LM:acdoc)) 'obj ':vlax-false) '(LM:ename->objectid (vlax-vla-object->ename obj)) ) '(itoa (vla-get-objectid obj)) ) ) ) (LM:objectid obj) ) ;; Entity Name to ObjectID - Lee Mac ; Returns the 32-bit or 64-bit ObjectID for a supplied entity name (defun LM:ename->objectid ( ent ) (LM:hex->decstr (setq ent (vl-string-right-trim ">" (vl-prin1-to-string ent)) ent (substr ent (+ (vl-string-position 58 ent) 3)) ) ) ) ;; Hex to Decimal String - Lee Mac ; Returns the decimal representation of a supplied hexadecimal string (defun LM:hex->decstr ( hex / foo bar ) (defun foo ( lst rtn ) (if lst (foo (cdr lst) (bar (- (car lst) (if (< 57 (car lst)) 55 48)) rtn)) (apply 'strcat (mapcar 'itoa (reverse rtn))) ) ) (defun bar ( int lst ) (if lst (if (or (< 0 (setq int (+ (* 16 (car lst)) int))) (cdr lst)) (cons (rem int 10) (bar (/ int 10) (cdr lst))) ) (bar int '(0)) ) ) (foo (vl-string->list (strcase hex)) nil) ) ;; Start Undo - Lee Mac ; Opens an Undo Group. (defun LM:startundo ( doc ) (LM:endundo doc) (vla-startundomark doc) ) ;; End Undo - Lee Mac ; Closes an Undo Group. (defun LM:endundo ( doc ) (while (= 8 (logand 8 (getvar 'undoctl))) (vla-endundomark doc) ) ) ;; Active Document - Lee Mac ; Returns the VLA Active Document Object (defun LM:acdoc nil (eval (list 'defun 'LM:acdoc 'nil (vla-get-activedocument (vlax-get-acad-object)))) (LM:acdoc) ) (vl-load-com) (princ (strcat "\n:: Lengfield.lsp | by TranThiep | " (menucmd "m=$(edtime,0,yyyy)") ", based lisp midlen.lsp \\U+00A9 Lee Mac " "\n:: Type \"lengfield\" to Invoke ::" ) ) (princ) ;;----------------------------------------------------------------------;; ; End of File ;; ;----------------------------------------------------------------------;;
Thân ái, chúc bạn thành công. TranThiep tel:0918841230
Cám ơn bác nhiều.
-
1
-
-
-
14 giờ trước, thiep đã nói:Có thể giúp bạn, cũng không khó, nhưng câu thứ 3 màu đỏ, chưa hiểu???
ý của em là ví dụ dim style hiện hành chiều cao text là 2 và dim scale là 100 thì lúc đó text xuất ra có chiều cao là = 2*100
-
1
-
-
1 giờ} trướ}c, Doan Nguyen Van đã nói:Thay vì sửa 1 lisp dài dằng dặc thế này, có khi viết lsp mới còn nhanh hơn bạn ạ
Bạn ơi, có thể giúp mình đc không
-
Chào các bác, em có tìm được lisp xuất chiều dài pline ra text field, nhờ các bác giúp em sữa lại cho phù hợp công việc của em:
- Chiều dài chỉ lấy số nguyên và làm tròn lên 10
- Text xuất ra có định dạng L=xxxx
- Chiều dài của text theo chiều cao text dim mặc định
Cám ơn các bác.
-
Cái này là em tự làm chứ ko có dùng lisp nào cả bác ơi, code lisp các kiểu em mù tịt, nếu có được lisp như bác nói thì tuyệt vời quá
-
Chào các bác, em có tự tạo block động để vẽ thép sàn, nhưng có 1 lỗi mà em vẫn chưa khắc phục được, em có 2 ATT là SH và CHU_THICH, nhưng 2 cái ATT lại có lúc lại nằm chồng lên nhau, em không hiểu tại sao. Nhờ các bác giúp em tìm ra cái lỗi này bị gì. Em cám ơn.
-
bạn ơi mình cài lại win thì load lại lisp thì báo đã đạt số máy tối đa
-
Vào lúc 18/4/2016 tại 21:53, quocmanh04tt đã nói:Tặng bạn cái này cùng với ACE nào cần (Còn mới nóng): :D
http://www.cadviet.com/upfiles/5/141736_khbv.rar
Trong đó: (Lệnh KHBV)
+ Pick : để lấy tên Tag của block thuộc tính.
+ Auto: Số thứ tự tự động (Tác dung với trường hợp bạn thay đổi STT bắt đầu, muốn khôi phục lại) - Mặc định là tự động.
+ Chức năng sort:
0 - None ... Cái nào chọn trước thì được trước ...
1,2,3,4 Có ghi rõ ràng ... (Nguyên tắc luôn từ trái qua phải).
P/s Có thể ứng dụng cho các loại att-block khác, không nhất thiết phải là khung tên.
Bạn ơi cho mình hỏi là lúc pick để lấy Tag của Block Att thì được, nhưng khi bấm Ok để quét các đối tượng block thì nó lại không nhận đối tượng là sao nhỉ
-
Nhờ sửa lisp
trong AutoLisp
Chào mọi người, mình tìm được trong diễn đàn 2 lisp:
1. Đổi các đối tượng được chọn về layer - layer mình có thể đặt trong code
2. Dim kích thước các pline
Mình muốn có thể gộp 2 lisp vào một để bấm lệnh sẽ thực hiện cả hai lisp trên. Mong mọi người giúp đỡ.
-
2
-
-
Vào lúc 12/5/2016 tại 23:12, hainguyen2014 đã nói:Bạn thứ xem đúng ý chưa nhé!
(prompt "Lenh NT")(defun C:NT() ;;;;;;;;;; NHAN VOI MOT SO ;;;;;;;;;;;(command "undo" "BE")(setq ttt (getreal "Nhap gia tri muon nhan : "))(setq tp (getint "Nhap so thap phan : "))(princ "Chon cac Text can nhan:")(setq ss (ssget '((0 . "TEXT"))))(setq j -1)(repeat (sslength ss)(setq j (+ j 1))(setq dt1 (ssname ss j))(setq el (entget dt1) )(setq gt (cdr (assoc 1 el) ))(setq gt1 (atof gt))(setq gt2 (* gt1 ttt))(setq gt2 (rtos gt2 2 tp))(setq elt (subst (cons 1 gt2) (assoc 1 el) el))(entmod elt))(command "undo" "END"))
Không chạy lệnh bạn ơi
-
-
Lisp tính tổng đai trong dim
trong Sử dụng AutoCAD
Đã đăng · Trả lời báo cáo
Chào các bác, em đã tạo ra các dim để auto tính số lượng đai ghi vào dim, nhờ các bác giúp em lisp tính tổng số lượng đai ở trong dim. Cám ơn các bác.
1.Nhập lệnh
2.Quét các dim
3.Xuất số lượng ra bảng thông báo: "số lượng"%%c@100/200
test.dwg