Originally Posted by
jessevas656864
I can't find the button to format as code.
Hit the button 'Go Advanced' below on the right side hand then from the new page hit the hash tag # or you can type the following but without spaces as I do.
[ c o d e ] YOUR CODES HERE [ / c o d e ]
Code:
(setq var (mapcar 'getvar '(ATTDIA ATTREQ)))
(mapcar 'setvar '(ATTDIA ATTREQ) '(0 0))
(if (tblsearch "BLOCK" "CONN")
(setq blk (vlax-invoke (vlax-get (vla-get-activelayout (vla-get-activedocument (vlax-get-acad-object))) 'Block)
'insertblock '(0. 0. 0.) "CONN" 1. 1. 1. 0.)
blst0 (vlax-vla-object->ename blk)
)
(and (or (setq dwg (findfile "CONN.dwg"))
(alert "Can't find drawing.")
)
(or (setq old (entlast)) (setq old ""))
(not (command "_.-INSERT" dwg "0,0" 1 0 ""))
(and (not (eq old (setq new (entlast))))
(setq blst0 new))
)
)
(mapcar 'setvar '(ATTDIA ATTREQ) var)
(if (and blst0
(= (cdr (assoc 0 (setq blst1 (entget blst0)))) "INSERT")
(setq blst2 (tblobjname "BLOCK" (cdr (assoc 2 blst1))))
)
(while (and blst2 (not (= (cdr (assoc 0 (setq ent (entget blst2)))) "SEQEND")))
(and (= (setq pnt (cdr (assoc 0 ent))) "POINT")
(setq blst3 (cons (list pnt blst2) blst3)))
(setq blst2 (entnext blst2))
)
)
(vl-load-com)