Message 1 of 8
replace block inside blocks and mantain properties
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
From here,
I take this from @Kent1Cooper
(defun BlockReplace (old new)
(vl-load-com)
(foreach
x
(mapcar 'cadr (ssnamex (ssget "_X" (list (cons 2 old)))))
(vla-put-name (vlax-ename->vla-object x) new)
); foreach
); defun
Usage for your example: (blockreplace "Supply Diffuser 24x24*" "V01")
It works, but...
I have this problem. The dwg was flattened in the past and I use the generic definition to replace the door block. But the replaced doors lost their properties of rotation, simmetry and scale. Is it possible to hace this definition but mantains the properties of the replaced block?
Also, this lsp doesn´t replace blocks inside blocks... Is it possible to fix it?
Thanks to all