rdilecce80
Guest
...:finger:: finger:...to the limit, if you want to change the layer, just change the line (vla-put-layer listent "4"), where "4" is the name of the layer
...:finger:: finger:...to the limit, if you want to change the layer, just change the line (vla-put-layer listent "4"), where "4" is the name of the layer
quando uso esptac, si crea la copia del blocco e me esplodeI have unfortunately found that the "notchs2" heels are stacked on the other and, according to the way, I should open the block and cancel the lines in submerged.
a
the double notches created me after using esptac.lspYou're right, I just missed the fact that when I use vla-explode, the program makes me a copy of the entities that make up the block, keeping the original, unlike the explode command, which instead eliminates the block. Therefore the counter also went for his. Now it should be fine.
If you can filter them up, it's better, otherwise I'll have to run a control system for the block coordinates and clear the blocks too. However you do not do in 5 minutes...:smile:
(defun c:esptac (/ blocks gru dima index listadima count)
(vl-load-com)
(setq blocks(vla-get-blocks (vla-get-activedocument(vlax-get-acad-object))))
gru(ssget '((0 . "insert")))
)
(repeat (setq index(sslength gru))
(setq dima(ssname gru (setq index(1- index))))
listadima(vla-item blocks (cdr(assoc 2))))
count 0
)
(vlax-for elem listadima
(if (and (equal (vla-get-objectname (vla-item listadima count)) "acdbblockreference")
(equal (vla-get-name (vla-item listadima count)) "notchs2")
)
(progn)
(setq listaent(car) (safearray-value(variant-value)Vla-explode (vla-item listadima count))))
(vla-put-layer listaent "4")
)
)
(setq count(1+ count))
)
)
(vla-get-activedocument(vlax-get-acad-object) acactiveviewport)
)
(defun c:esptac (/ blocks gru index dima listadima)
(vl-load-com)
(setq blocks(vla-get-blocks (vla-get-activedocument(vlax-get-acad-object))))
gru(ssget '((0 . "insert")))
)
(repeat (setq index(sslength gru))
(setq dima(ssname gru (setq index(1- index))))
listadima(vla-item blocks (cdr(assoc 2))))
)
(vlax-for elem listadima
(if (and (equal (vla-get-objectname elem) "acdbblockreference")
(equal (vla-get-name elem) "notchs2")
)
(progn)
(vla-put-layer (car (safearray-value(variant-value(vla-explode elem))))))) "4")
(vla-delete elem)
)
)
)
)
(vla-get-activedocument(vlax-get-acad-object) acactiveviewport)
(alert "tacche esplose!")
)