Tharwat 发表于 2022-7-5 19:17:09

我试过了,但不幸的是,我没有遇到障碍:(

hosyn 发表于 2022-7-5 19:18:21

hosyn 发表于 2022-7-5 19:23:14

Yes exsactly:?

Tharwat 发表于 2022-7-5 19:28:40

The block is already inserted or you want to insert it first ?
 
What are the name of the three layers ?

hosyn 发表于 2022-7-5 19:30:09

the main block name is: "ttblok" and inserted in layer "layer1"
now after running the code "ttblock" copied to specified layers "layer2" and "layer3"

Tharwat 发表于 2022-7-5 19:35:54

Try this:
 

(defun c:Test (/ ss) ;;    Tharwat 20.09.2015    ;; (cond   ((vl-some '(lambda (l) (not (tblsearch "LAYER" l))) '("Layer2" "Layer3"))            (alert "One of the two layers is not found < Layer2 / Layer3 > :"))   ((and (princ "Select Block to copy two times :")         (setq ss (ssget "_:L" '((0 . "INSERT") (2 . "ttblok"))))    )    ((lambda (x / sn)       (while (setq sn (ssname ss (setq x (1+ x))))         (mapcar         '(lambda (u)            (entmake                (append                  (list '(0 . "INSERT") '(2 . "ttblok") (cons 8 u))                  (vl-remove-if-not                  '(lambda (v)                     (member (car v) '(6 10 41 42 43 50 62 370))                     )                  (entget sn)                  )                )            )            )         '("Layer2" "Layer3")         )       )   )      -1    )   ) ) (princ))

hosyn 发表于 2022-7-5 19:37:36

I tried it but unfortuanatelly don't get blocks:(
页: 1 [2]
查看完整版本: 有没有制作lisp代码的想法?