PDA

View Full Version : Changing the names of a copied Xref



BCrouse
2004-07-08, 12:57 PM
Changing the names of a copied Xref’s. My idea would allow you to copy an Xref in your drawing and being able to change the name of it. It will still be the original Xref but with a different name.

At the present time you have to invoke the Xref Manager and rename the current Xref before you can attach the same one again. My idea will eliminate a few steps in changing the name.


Thank you,

Brad

tomdillenbeck
2004-07-08, 05:42 PM
Adding a "name" field in the properties dialog would be a nice option.

BCrouse
2004-07-08, 06:00 PM
One thing that I forget to suggest is that the new name should only be for Xref the was just picked. It should not change anything else.




Brad

jhohman
2004-07-09, 01:49 PM
I know this isn't the LISP area, but couldn't someone write a routine (refcopy maybe?) that will allow you to select the xref to be copied and allow the user to specify the name of the copied xref?

Glenn Pope
2004-07-09, 03:46 PM
Here is something I just wrote. See if this works.

Works with 2000 and newer.


(defun c:copyxref (/ *error* CMD FD OBJ EN XREF ADD INS SCLX SCLY ROT)
(defun *error* (msg)
(if (or (= msg "Function cancelled")
(= msg "quit / exit abort")
)
(progn
(setvar "cmdecho" CMD)
(setvar "filedia" FD)
(princ)
)
(princ (strcat "\nError: " msg))
)
)
(setq CMD (getvar "cmdecho"))
(setq FD (getvar "filedia"))
(setvar "cmdecho" 0)
(setvar "filedia" 0)
(while (/= OBJ 1)
(setq EN (entsel "\nSelect Xref to insert: "))
(cond
((not EN)
(progn
(cond
((= (getvar "errno") 7) (princ "\nNo Xref selected"))
((= (getvar "errno") 52) (exit))
)
)
)
((/= (cdr (assoc 0 (entget (car EN)))) "INSERT")
(princ "\nNot an Xref")
)
((= 4
(logand
(cdr
(assoc
70
(entget
(tblobjname "block" (cdr (assoc 2 (entget (car EN)))))
)
)
)
4
)
)
(setq OBJ 1)
)
(T (princ "\nNot an Xref"))
)
)
(setq XREF (cdr (assoc 2 (entget (car EN)))))
(setq ADD
(cdr
(assoc 1
(entget
(tblobjname "block" (cdr (assoc 2 (entget (car EN)))))
)
)
)
)
(setq NEWNAME (getstring "\nName of XREF: "))
(setq INS (getpoint "\nSpecify insertion point: "))
(setq SCLX (getreal "\nEnter X scale factor: "))
(setq SCLY (getreal "\nEnter Y scale factor: "))
(setq ROT (getreal "\nSpecify rotation angle: "))
(command "XREF"
"Overlay"
(strcat NEWNAME "=" ADD)
INS
(rtos SCLX)
(rtos SCLY)
(rtos ROT)
)
(exit)
)

This will ask to select xref, Name, X scale, Y scale & Rotation.