Author Topic: xref names  (Read 1916 times)

0 Members and 1 Guest are viewing this topic.

Anonymous

  • Guest
xref names
« on: August 11, 2004, 11:42:30 AM »
We have a dwg which has 120 xref blks in it.  Most of them are duplicated.  However they all have diff names. It is an assisted living facility complex. Here is how the architect set it up:  

flrpln is the file

xrefs:.....model1, model2, model3.....model11

All models are xrefed in flrpln, there are 16 model1 units, but instead of xref model1 in once and copy around, model1 was xref in 16 times and was given diff names each time like:  unit-14, unit-15, unit-21, unit96...etc.  Now we end up having 120 xref blks insteads of 11. Therefore it is difficult  to work in layer dialog box.

 We try to use Layer Filter but it does not quite work well. Is there a way get them back to just 11 xref?

CADaver

  • Guest
xref names
« Reply #1 on: August 11, 2004, 11:53:45 AM »
Try this:
Code: [Select]
(defun c:REPLs (/ ENT1 BL1 bl2 OLD ODNM)
 (prompt "\nSelect Replacement Block: ")
 (setq bl2 (cdr (assoc 2 (entget (car (entsel))))))
 (prompt "Select blocks to replace: ")
 (setq ENT1 (ssget))
 (setq N (sslength ENT1))
 (setq I 0)
 (repeat N
  (setq BL1 (entget (ssname ENT1 I)))
  (setq NWNM (cons 2 bl2))
  (setq OLD (assoc 2 BL1))
  (setq ODNM (cdr OLD))
  (entmod (subst NWNM OLD BL1))
  (setq I (1+ I))
 )
 (princ)
)

ryandk

  • Guest
xref names
« Reply #2 on: August 11, 2004, 12:58:58 PM »
This may seem a little low tech for you programmer types out there, but couldn't you copy the first xref, rotate if needed, and move into correct location on top of the existing xrefs.  Then just detach the extraneous xrefs.  It shouldn't be too much work, you said there were only 16 or so units.

yyou

  • Guest
xref names
« Reply #3 on: August 11, 2004, 01:36:24 PM »
Thanks for your help Cadaver and ryandk

sorry I wasn't clear.  There are 120 units.  I only took Model1 to be an example.  Some of the models are very similar that we cannot tell the differences between them.  We cannot just change them, we have to pick and check, what model was used for that unit, on almost everyone of them.