TheSwamp
CAD Forums => CAD General => Topic started by: craigr on August 15, 2012, 10:58:00 AM
-
I've recieved a drawing from a Coworker that has many blocks in it.
When I go to edit them in the Block Editor, they have nonsensicle names such as 'A$4E676C4A'.
I would like the names to actually mean something like '8inchbolt' instead. But, I don't want to have to explode each one and then make a new block with the new name.
Is there a command to just rename them?
craigr
-
There is a command "RENAME" but you don't get a preview of the block so you would have to know what they were from the name that they have now.
-
Got it. - Thanks
I don't know how I haven't run into that before.
craigr
-
In 2011 the block editor has is an option to "save as".
-
Ah, yes, the joys of users discovering paste as block. The users around here have been... educated... about not using that, precisely for that reason.
-
Give this a try (http://www.theswamp.org/index.php?topic=42378.0;all)
-
Give this a try (http://www.theswamp.org/index.php?topic=42378.0;all)
OP has LT, no lisp.
-
The 'Rename' thing worked great.
Though, as mentioned, it would be nice if there was a preview window so you don't have to remember the name of the block you want to change.
craigr
-
Another relate question....
Now that I have renamed their blocks to appropriate 'Standard' names, is there a way to change the properties so that the block cannot be exploded?
Other than explode it and make a 'new block' with the same name and deselect the 'explode' option.
craigr
(edited) - Yes I DID look thru the properties box AND in the Block editor and haven't found the option. - It MAY be there, but I haven't been able to spot it.
(edit AGAIN) - I DID find it!! - You have to open the Properties Bar within the Block editor. When I looked previously, I selected the block THEN opened the properties bar.
Craigr
-
Everybody could have told you that :P ;)
There is even an easier/faster way: - Start the BLOCK command (B , <ENTER>)
- Select the block from the roll menu (ALT-N , <DOWNARROW>)
- Check or uncheck 'Allow exploding' (ALT-E)
- OK (<ENTER>)
- Accept to redefine the block (<ENTER>)
-
Good way to take advantage of an annoying feature there, Crank :)
dJE
-
I use this:
(defun c:BlockRename ()
(vl-load-com)
(setq bname (vla-get-EffectiveName (vlax-ename->vla-object (car(entsel "\nSelect block: ")))))
(command "rename" "block" bname pause)
);DEFUN
Command: blockrename
Select block:
rename
Enter object type to rename
[Block/Dimstyle/LAyer/LType/Material/Style/Tablestyle/Ucs/VIew/VPort]: block
Enter old block name: A$C7EDB4DDE
Enter new block name: New Block Name
Command: nil
-
(defun c:BlockRename ()
(vl-load-com)
(setq bname (vla-get-EffectiveName (vlax-ename->vla-object (car(entsel "\nSelect block: ")))))
(command "rename" "block" bname pause)
);DEFUN
A minor upgrade for you Dommy on the house:
(defun c:blockrename
( / *error* ent
) (princ "\nMissed, try again.") )
(princ "\nSelected object is not a Block.") )
)
)
)
)
)
-
Sometimes I feel like 'the red-headed stepchild' with you FULL CAD people.
:)
-
< .. >
A minor upgrade for you Dommy on the house:
What other options are there ?
:)
-
Those are the types of things I want to start incorporating to go to the next level. Much appreciated!!! :kewl:
(defun c:BlockRename ()
(vl-load-com)
(setq bname (vla-get-EffectiveName (vlax-ename->vla-object (car(entsel "\nSelect block: ")))))
(command "rename" "block" bname pause)
);DEFUN
A minor upgrade for you Dommy on the house:
(defun c:blockrename
( / *error* ent
) (princ "\nMissed, try again.") )
(princ "\nSelected object is not a Block.") )
)
)
)
)
)
-
You're very welcome Dommy :-)
-
OK, I'm lost. What's happening here:
'(( m ) (princ))
-
OK, I'm lost. What's happening here:
'(( m ) (princ))
Implied defun-q expression
The interpreter will automatically assume that quoted list structure to be a function defined using defun-q and evaluate it as such.
Consider the following example:
_$
(setq x '
((a
) (+ a
5)))((A) (+ A 5))
(A)
(+ A 5)
_$ (x 2)
7
((A) (+ A 5))
-
I see, thanks for the explanation.
Though I think that I'll stick to be using defun-q :) .