--
Karl
(|:-{>
"Karl" <kdh...@att.net> wrote in message
news:nhf20v0on1g09pos7...@4ax.com...
It has to do with the COPY With a Base Point command.
That is how I insert windows in my architectural drawings.
ACAD gives the blocks a random "coded" name. That's what I'm truly
after -- to rename blocks with names like "A$C3D38282D".
Sorry, can't be of more much help other than going along with Paul's
suggestion?
You can still automate that process by creating a routine that will prompt a
user to select a block to rename and the name name, then have the routine
save it's current settings (layer, insertion point, rotation angle, etc)
then explode it and create the block with those settings and the new name.
--
Kevin Nehls
"Karl" <kdh...@att.net> wrote in message
news:nhf20v0on1g09pos7...@4ax.com...
I think this is what you want.
Joe Burke
;make a copy of a block with a new name
;select block to copy, enter new name, pick insertion point
;remove pause "1" "1" "0" at end to control block scale and
;rotation while inserting the copied block
;doesn't seem to work with anonymous blocks
;thanks to Alex Repetto for code posted to Customization NG
;thanks to Jason Piercey for his help
;code revised Joe Burke July 29, 2001
(defun C:CopyBlock2 (/ *error* OldBlockName NewBlockName
rewind BlockName Info BlockInfo ent_name ent_info)
(defun *error* (Msg)
(cond
((or (not Msg)
(member Msg '("console break"
"Function cancelled"
"quit / exit abort"))))
((princ (strcat "\nError: " Msg)))
) ;cond
(princ)
) ;end error
(sssetfirst)
(setq OldBlockName (entsel "\nSelect Block to copy: "))
(while
(or
(null OldBlockName)
(/= "INSERT" (cdr (assoc 0 (entget (car OldBlockName)))))
)
(princ "\nSelection was not a block - try again...")
(setq OldBlockName (entsel "\nSelect Block to copy: "))
)
;block name
(setq OldBlockName (strcase (cdr (assoc 2 (entget (car OldBlockName))))))
;new name
(setq NewBlockName (getstring T "\nEnter new block name: "))
;block definition
(setq rewind T)
(while (setq Info (tblnext "BLOCK" rewind))
(setq BlockName (strcase (cdr (assoc 2 Info))))
(if (= OldBlockName BlockName)
(setq BlockInfo Info)
)
(setq rewind nil)
)
(if BlockInfo
(progn
(setq ent_name (cdr (assoc -2 BlockInfo)))
;header definition:
(entmake (list '(0 . "BLOCK")
(cons 2 NewBlockName)
'(70 . 2)
(cons 10 '(0 0 0))
)
)
;body definition:
(entmake (cdr (entget ent_name)))
(while (setq ent_name (entnext ent_name))
(setq ent_info (cdr (entget ent_name)))
(entmake ent_info)
)
;footer definition:
(entmake '((0 . "ENDBLK")))
(command "-INSERT" NewBlockName pause "1" "1" "0")
)
)
(*Error* nil)
(princ)
) ;end
"Karl" <kdh...@att.net> wrote in message
news:ar940v4lmf1d2sicm...@4ax.com...
--
Daniel J. Altamura, R.A.
Altamura Architectural Consulting
and SoftWorx, Autodesk Authorized Developer
DAlt...@compuserve.com
-----------------------------------------------------------------
"Karl" <kdh...@att.net> wrote in message
news:nhf20v0on1g09pos7...@4ax.com...