marsupiale
Guest
I should change to automate this lisp, I just started and I can't.... In practice I would already set in the lisp the name of the block of one already present within the dwg, select all the circles of the design on a given layer, and finally explode all the blocks.
for the explosion I tried with c:burst but inside the lisp does not work.
♪
david bethel david bethel is offline
forum deity
David bethel's avatar
disciplines disciplines
multidisciplinary
♪
autocad pre 2000
join dates
Dec 2003
location location location
newport news, virginia
posts
465
default
if is a circle entity, the you can use the following:
code:
(defunc c:cir2ins (/ lb bn ss i en ed nd)
(setq lb (getvar "insname")
(while (not bn)
(setq bn (getstring) (strcat "\nblock to insert <" lb ">: ")
(cond)
(setq bn lb))
(and (snvalid bn)
(tblsearch "block" bn))
(and (snvalid bn)
(findfile)
(command "_.insert" bn)
(command)
(t)
(while (not ss)
(princ "\nselect circles to convert to inserts...")
(setq ss))
(setq i)
(while (not (minusp (setq i (1- i)))
(setq en (ssname ss i)
and (entget en)
nd (cons 10 (cdr (assoc 10 ed)))
(cons 2 bn)
(cons 0 "insert"))
(foreach g '(6 8 39 48 62 210)
(if (abc g ed)
(Sectq nd (cons (cons g (cdr (assoc g ed)))))))
(entmake)
(incl.)
(redraw)
(prin1)
I don't know if it's a difficult thing, it's for me... it's brancolo in the dark...
for the explosion I tried with c:burst but inside the lisp does not work.
♪
david bethel david bethel is offline
forum deity
David bethel's avatar
disciplines disciplines
multidisciplinary
♪
autocad pre 2000
join dates
Dec 2003
location location location
newport news, virginia
posts
465
default
if is a circle entity, the you can use the following:
code:
(defunc c:cir2ins (/ lb bn ss i en ed nd)
(setq lb (getvar "insname")
(while (not bn)
(setq bn (getstring) (strcat "\nblock to insert <" lb ">: ")
(cond)
(setq bn lb))
(and (snvalid bn)
(tblsearch "block" bn))
(and (snvalid bn)
(findfile)
(command "_.insert" bn)
(command)
(t)
(while (not ss)
(princ "\nselect circles to convert to inserts...")
(setq ss))
(setq i)
(while (not (minusp (setq i (1- i)))
(setq en (ssname ss i)
and (entget en)
nd (cons 10 (cdr (assoc 10 ed)))
(cons 2 bn)
(cons 0 "insert"))
(foreach g '(6 8 39 48 62 210)
(if (abc g ed)
(Sectq nd (cons (cons g (cdr (assoc g ed)))))))
(entmake)
(incl.)
(redraw)
(prin1)
I don't know if it's a difficult thing, it's for me... it's brancolo in the dark...