HCBBS Forum (English)
Submit Chemical Projects / Find Solutions
Amplify Your Requirements on a Broader Chemical Platform *Engineering · Technology · Equipment · Solutions*
Submit Request

How to replace blocks in CAD?

2009-02-20View Original

Thread Content

Want to replace existing blocks of a certain type in the picture with existing blocks
Reply #22009-02-20
;;* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ;Selected block replacement(defun dim_scei_cbt () (if (and (setq a (entsel "\nSelect a Block for change :")) (setq ent (entget(car a))) (= (cdr (assoc 0 ent)) "INSERT")) (if (and (setq b (entsel "\nSelect a Block for change :")) (setq ent1 (entget(car b))) (= (cdr (assoc 0 ent)) "INSERT")) (entmod (subst (assoc 2 ent) (assoc 2 ent1) ent1)) ) ) (princ) )
Reply #32009-02-20
Oh, I forgot, the above program uses dialog box, if it is used alone, put dim_scei_ Just change it to c:
Reply #42009-02-20
It's so profound that I can't quite understand it. . .
Reply #52009-02-20
Copy it to notepad, save it as 123.LSP, and load it in cad! The code is as follows;; * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ;Selected block replacement (defun c:cbt () (if (and (setq a (entsel "\nSelect a Block :")) (setq ent (entget(car a))) (= (cdr (assoc 0 ent)) "INSERT")) (if (and (setq b (entsel "\nSelect a Block for change :")) (setq ent1 (entget(car b))) (= (cdr (assoc 0 ent)) ent)) "INSERT")) (entmod (subst (assoc 2 ent) (assoc 2 ent1) ent1)) ) ) (princ) )
Reply #62009-02-21
This is accomplished by exploding the block and then redefining it.
Reply #72009-02-21
Didn't understand what it meant. Isn’t it possible to delete the existing block and insert another block?

Submit a Project

**Looking for Chemical Technology, Equipment & Solutions?** No Registration Required Broader Platform Exposure | Global Chemical Service Provider Connections

Submit Request — Free Consultation

Disclaimer

This is an automated machine translation of the original thread. Some technical terms may have inaccuracies; the original text shall prevail. Click "View Original" at the top right to access the source page, which supports IP-based automatic real-time language translation. Please watch out for contact details and sales inducements to prevent fraud. All content and translations are for reference only, representing solely the poster's personal views. For enquiries, email service@hcbbs.com.