Chuyển đến nội dung
Diễn đàn CADViet

NguyenMinh88

Thành viên
  • Số lượng nội dung

    27
  • Đã tham gia

  • Lần ghé thăm cuối

  • Ngày trúng

    1

Bài đăng được đăng bởi NguyenMinh88


  1. Mình tìm lisp này  nhưng thay dổi linestyle scale thì nhân với  linestye hiện có ;

    Mình mong muốn nhập vào 100 thi linestye scale la 100 . không nhân với linesty scale hiện có.

    cám ơn các bạn đã giúp !

    ;Change linetype scale by a factor.
     (defun c:lrr ()
     (setq en (car (entsel))
           ed (entget en)
          lts (cdr (assoc 48 ed))
     )
     (if (/= lts nil)
      (progn
       (setq ns (getreal (strcat "\nScale linetype what factor of current scale? Current scale: <"(rtos lts)">. "))
            ns2 (* (/ ns ) lts)
       )
       (setq ed
           (subst (cons 48 ns2)
                  (assoc 48 ed)
                  ed
           )
       )
       (entmod ed)
       (entupd en)
      );progn

    (progn
       (setq ns (getreal (strcat "\nScale linetype to what factor of current scale? Current scale: <"(rtos 1)">."))
            ns2 (* (/ ns ) 1)
       )  
       (command "change" en "" "p" "s" (rtos ns2) "")
      )
     );if
    )

    • Vote giảm 1

  2. (defun c:layren ( / enx obj old new )
        (setq old "Layer_to_be_Renamed"
              new "New_Layer_Name"
        )
        (if (and (setq obj (tblobjname "layer" old))
                 (setq enx (entget obj))
            )
            (entmod (subst (cons 2 new) (assoc 2 enx) enx))
        )
        (princ)
    )

    mình tìm được lisp này trên mạng của Lee_maC . nhưng không sử dụng được . ( không biết phải lisp đổi tên layer không )

    Mình mong muốn lisp chọn đối tượng và đổi tên layer của đối tượng đó . không tạo ra layer mới

    Xin cám ơn các bạn đã giúp đỡ ( mình dùng lệnh rename trongcad thi hơi lâu )

     

    • Vote giảm 1

  3. xin chào các bạn ! các bạn rành về lisp xemgiúp minh cau  lệnh lisp này là gi!

    xin cám on !

    minh tìm duoc trên trang lee_mac

     

    ;;-------------=={ Full Path to Relative Path }==-------------;;
    ;;                                                            ;;
    ;;  Converts a Full XRef path to a Relative Path.             ;;
    ;;------------------------------------------------------------;;
    ;;  Author: Lee Mac, Copyright © 2011 - www.lee-mac.com       ;;
    ;;------------------------------------------------------------;;
    ;;  Arguments:                                                ;;
    ;;  dir  - Directory of the Drawing in which the Xref resides ;;
    ;;  path - Full Xref Path                                     ;;
    ;;------------------------------------------------------------;;
    ;;  Returns:  Relative XRef Path                              ;;
    ;;------------------------------------------------------------;;

    (defun LM:XRef:Full->Relative ( dir path / p q )
        (setq dir (vl-string-right-trim "\\" dir))
        (cond
            (   (and
                    (setq p (vl-string-position 58  dir))
                    (setq q (vl-string-position 58 path))
                    (not (eq (strcase (substr dir 1 p)) (strcase (substr path 1 q))))
                )
                path
            )
            (   (and
                    (setq p (vl-string-position 92  dir))
                    (setq q (vl-string-position 92 path))
                    (eq (strcase (substr dir 1 p)) (strcase (substr path 1 q)))
                )
                (LM:Xref:Full->Relative (substr dir (+ 2 p)) (substr path (+ 2 q)))
            )
            (   (and
                    (setq q (vl-string-position 92 path))
                    (eq (strcase dir) (strcase (substr path 1 q)))
                )
                (strcat ".\\" (substr path (+ 2 q)))
            )
            (   (eq "" dir)
                path
            )
            (   (setq p (vl-string-position 92 dir))
                (LM:Xref:Full->Relative (substr dir (+ 2 p)) (strcat "..\\" path))
            )
            (   (LM:Xref:Full->Relative "" (strcat "..\\" path)))
        )
    )
     

    • Vote giảm 1

  4. Xin chào các bạn !

    lisp này không chạy được .

    Nhờ chỉnh giúp !

    xin cám ơn.

    (defun c:xref (/ ent_list x-nam x-ref x-path x)
      (setvar
    "cmdecho" 0)
     (defun *error* (msg)
       (command
    "xref" "r" x-nam)
       (princ msg)

       (princ)
     )
      (setq ent_list
    (entget (car (entsel "\nXREF Edit\nOpens selected XREF for editing.\nSelect
    Xref to edit:"))))
      (setq x-nam (cdr (assoc 2 ent_list)))

      (setq x-ref (tblsearch "block" x-nam))
      (setq
    x-path (cdr (assoc 1 x-ref)))
      (command "xref" "u" x-nam)

      (command "vbastmt" (strcat "AcadApplication.Documents.Open "
    (chr 34) x-path (chr 34)))
      (setq x (getkword "\nPress
    <ENTER> to reload XREF:"))
      (command "xref" "r" x-nam)

      (princ)
    )


  5. Xin chào các bạn !

    Minh download trên web lips  dùng editblock in place

    nhưng dùng khá bất tiện.

    vui lòng chỉnh giúp mình khong bấm vào select để chọn đối tượng mà bỏ qua dòng nhắc này và chọn đối tượng luôn được không

    Xin cám on

     

    (defun c:test  (/ opt)
     (setvar 'cmdecho 0)
     (vl-load-com)
     (initget "DD EE FF Select")
     (setq opt (getkword "\nSelect block entity or [DD/EE/FF/Select]: "))
     (cond
      ((or (= "DD" opt)
         (= "EE" opt)
         (= "EE" opt))
                 (sssetfirst nil (ssget "_x" (list '(0  . "INSERT") (cons 2 opt))))
      (vl-cmdf "_.-refedit")
       (while (> (getvar "CMDACTIVE") 0)
        (command "_o" "" "")
      )
     )
     
    ((= "Select" opt)
     (sssetfirst nil (ssget ":S" '((0 . "INSERT"))))
      (vl-cmdf "_.-refedit")
       (while (> (getvar "CMDACTIVE") 0)
        (command "_o" "" "")
      )
      )
    )
    (setvar 'cmdecho 1)
    (princ)
    )


  6. Vâng cám ơn bạn ! 02 lisp đó mình dều load trên mạng

    1 . Lisp thứ 1 thì giống như lệnh edit block trong cad . > bạn giúp  viết thêm không cần hiện lên bản click chon vào biệu tuong + hay - dể remove đối tượng ,

    2  lisp thứ 2 thì remove và xóa đối tuong đó luôn.> bạn  giúp chỉnh lisp remove đối tuong mà không xóa .

    Mình mong muốn remove đối tuong trong block nhu khong xóa đối tượng.

    Xin cám ơn bạn .


  7. Xin chào các bạn ! Mình tìm được lisp này trên mạng

    Mình khong hiểu gì về lisp

    Nhờ các bạn hiểu về lisp  chỉnh sửa đoạn lisp này

    lisp này chỉ hiện lên bảng giúp chúng ta chọn thêm hày remove đối tương ra khỏi block và bấm nút save trên bản hiện ra

    Vậy có cách nào giúp chọn đối tường và remove  và save lại mà không hiện bảng chỉ dẫn ( ý là bỏ qua bước hiện bản giúp chọn và save )

    Xin cám ơn các bạn đã giúp đỡ.

    (defun c:Rm  ()
      (if(=(strlen(getvar 'refeditname))0)
        (progn
          (sssetfirst nil(ssget "_:S" '((0 . "INSERT"))))
          (command "-refedit" "O" "" "")
          
        )
        (command "refCLOSE" "" "")
      )
      (princ)
     

     

×