Community
AutoCAD Forum
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Block name

11 REPLIES 11
SOLVED
Reply
Message 1 of 12
Henrik_Lo
6803 Views, 11 Replies

Block name

HI

 

I need some help regarding block’s

Look at this special shape called *u54, I like to make a new block and replace it whit a new block

Shape, but AutoCAD are not aloud med to give a name *U54.

I can’t see this block in the block library

 

Cane someone help me out regarding this special block

 

Regards

Henrik

11 REPLIES 11
Message 2 of 12
AcadAdamLT
in reply to: Henrik_Lo

Hi

A block named *Uxx is anonymous block for Autocad, they are created when a dynamic block is modified, it's Autocads way of keeping track of different parameter values in block of same type.

You'll have to open the original block and resave it as a new block.

 

Here's a related topic:

http://forums.autodesk.com/t5/Dynamic-Blocks/U-anonymous-block-handles/td-p/3142278

Signature, sincerely... //Adam
AutoCad LT 2016
Give Kudos where credit is due, Mark "accepted as solution" if the post solved your question.
Message 3 of 12

(defun c:ren_ablk () (vl-load-com) (setq b_nam (getstring "\nEnter new block name: ")) (setq a_app (VLAX-GET-ACAD-OBJECT) a_doc (vla-get-ActiveDocument a_app) a_blks (vla-get-blocks a_doc) i 0 ) (setq BNAME (cdr (assoc 2 (entget (car (entsel)))))) (setq blk (vla-item a_blks BNAME)) (setq inspt (vla-get-origin blk) cnt (- (vla-get-count blk) 1) newfil (vlax-make-safearray vlax-vbobject (cons 0 cnt)) ) (vlax-for ent blk (vlax-safearray-put-element newfil i ent) (setq i (1+ i)) ) (if (null (tblsearch "BLOCK" b_nam)) (setq newblk (vla-add a_blks inspt b_nam)) (setq newblk (vla-add a_blks inspt (strcat b_nam "X"))) ) (vla-copyobjects a_doc newfil newblk nil) (setq BSEL (eval (selset))) (if BSEL (progn (setq BNDX 0) (while (< BNDX (sslength BSEL)) (setq BNDT (entget (ssname BSEL BNDX))) (setq BNDT (subst (cons 2 B_NAM) (assoc 2 BNDT) BNDT)) (setq BNDT (subst (cons 70 0) (assoc 70 BNDT) BNDT)) (entmod BNDT) (setq BNDX (1+ BNDX)) ) ) ) (princ) ) (defun selset (/ ent ss) (setq ent (entnext)) (setq ss (ssadd)) (while ent (if (= BNAME (cdr (assoc 2 (entget ent)))) (progn (ssadd ent ss) (setq ent (entnext ent)) ) (setq ent (entnext ent)) ) ) ss ) I use this lisp to rename anonymous blocks. Found it here once and works okay.
Message 4 of 12

weird, linebreaks don't work no more here when pasting from notepad?
Message 5 of 12
maxim_k
in reply to: Henrik_Lo

And another Lisp for renaming anonymous blocks:

 

(defun C:RenABlock ()
  (prompt "\nSelect anonymous block:")
  (setq old_name (cdr (assoc 2 (entget (car (entsel))))))
  (setq new_name (strcat "New block-" (substr old_name 2)))
(vla-put-Name
  (vla-item
    (vla-get-Blocks
      (vla-get-ActiveDocument
        (vlax-get-acad-object)
      )
    )
  old_name)
new_name)
  )

 

 

Pick anonymous block and get it renamed to "New block- OLD_ANONYMOUS_BLOCK_NAME"

 

Maxim


Do you find the posts helpful? "LIKE" these posts!
Have your question been answered successfully? Click 'ACCEPT SOLUTION' button.


Maxim Kanaev
Architect
MARSS

MacACAD | Linkedin

Etiquette and Ground Rules of Autodesk Community
Message 6 of 12
maxim_k
in reply to: vandenoosterkamp

Try to insert as CODE

Maxim

Do you find the posts helpful? "LIKE" these posts!
Have your question been answered successfully? Click 'ACCEPT SOLUTION' button.


Maxim Kanaev
Architect
MARSS

MacACAD | Linkedin

Etiquette and Ground Rules of Autodesk Community
Message 7 of 12
3wood
in reply to: Henrik_Lo

You can also try attached QRB.vlx

 

Message 8 of 12
Henrik_Lo
in reply to: 3wood

Hi all. Thanks for quick reply. All of it worked out fine for me.

Regards
Henrik

Message 9 of 12
dmfrazier
in reply to: maxim_k

Maxim,

Thanks for posting that handy little routine.  I was surprised to discover that once the name of a modified dynamic block (one with an "anonymous" name) is changed you can then insert a copy of the "new" block definition, which is now non-dynamic (while any other versions of the DB remain dynamic).  Apparently the renaming breaks the link to the original DB (just as running RefEdit would).  That makes for a handy shortcut for creating a static block based on a certain instance of a dynamic one.

 

Note that the routine will rename a block regardless of whether it has an "anonymous" name or not (IOW it's not exclusively for modified dynamic blocks). If you add a check for the "*" (asterisk) at the beginning of the "old_name", it could be made into a nice utility for renaming "only" DBs. Smiley Wink

Message 10 of 12
maxim_k
in reply to: dmfrazier

That was "quick and dirty" solution, of course there could be a lot of improvements Smiley Wink
I even did not think about the effect on editing Dyn Block name with this routine.

Maxim

Do you find the posts helpful? "LIKE" these posts!
Have your question been answered successfully? Click 'ACCEPT SOLUTION' button.


Maxim Kanaev
Architect
MARSS

MacACAD | Linkedin

Etiquette and Ground Rules of Autodesk Community
Message 11 of 12
ribartolo
in reply to: maxim_k

Thanks!

This one work as well

Message 12 of 12
hssalama
in reply to: maxim_k

Great, thanks.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost