Author Topic: Renaming XRefs  (Read 17406 times)

0 Members and 1 Guest are viewing this topic.

cmwade77

  • Swamp Rat
  • Posts: 1443
Renaming XRefs
« on: November 12, 2010, 11:12:03 AM »
Ok, so with reference manager, it is easy to handle when we need to move xrefs or rename folders....but I have a different issue......

First, here is our normal workflow:
  • Get backgrounds from Architect
  • Clean them up (Overkill, color 8, shaded, make everything bylayer, etc.
  • Setup sheets with these files xrefed in

We usually try to keep the architect's filenames the same, to make it easier if we need to send CAD files back to them and it's usually how they want it.

Here's the problem though, some architects like to rename the files every time that they send them to us, unfortunately we never know which architects are going to do this and which ones aren't when we setup the projects initially. When we only have one or two files from the architect, this is no real problem; however, there are times where there are 100+ files that the architect has renamed. I can usually get them to fill out a list of old to new filenames fairly quickly when this happens, so I am wondering if anyone has or knows of a routine that can read a file with this list (most likely a .csv, excel or text file) and modify the xrefs inside of drawings or rename the files back to the original names, etc.?

I am going to work on one, but I didn't want to reinvent the wheel if it already exists. I have searched for one, but haven't come across anything that is quite what is needed.

GDF

  • Water Moccasin
  • Posts: 2081
Re: Renaming XRefs
« Reply #1 on: November 12, 2010, 11:14:45 AM »
Stupid architects...LOL
Why is there never enough time to do it right, but always enough time to do it over?
BricsCAD 2020x64 Windows 10x64

cmwade77

  • Swamp Rat
  • Posts: 1443
Re: Renaming XRefs
« Reply #2 on: November 12, 2010, 11:24:33 AM »
Ah, it happens, just trying to make our life a little easier to deal with it.

JohnK

  • Administrator
  • Seagull
  • Posts: 10626
Re: Renaming XRefs
« Reply #3 on: November 12, 2010, 11:31:20 AM »
Quote
(vlax-Dump-Object (vlax-Ename->Vla-Object (car (entsel))) T)
; Property values:
;   ...
;   Name = "XREF-NUMBER-ONE--"
;   ...
;   Path = "C:\\tmp\\DRAWING-ONE.dwg"
TheSwamp.org (serving the CAD community since 2003)
Member location map - Add yourself

Donate to TheSwamp.org

ronjonp

  • Needs a day job
  • Posts: 7527
Re: Renaming XRefs
« Reply #4 on: November 12, 2010, 11:36:39 AM »
I'd talk to the client.

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC

Lee Mac

  • Seagull
  • Posts: 12913
  • London, England
Re: Renaming XRefs
« Reply #5 on: November 12, 2010, 11:46:14 AM »
I believe you would need to alter the xref name in the block table, but check for duplicate keys first.

Maybe something along these lines... unless I've misunderstood you:

Code: [Select]
(defun c:XRefUpd ( / b ) (vl-load-com)
 
  (vlax-for x
    (vla-get-Blocks
      (vla-get-ActiveDocument
        (vlax-get-acad-object)
      )
    )
    (if
      (and
        (eq :vlax-true (vla-get-isXref x))
        (setq b (vl-filename-base (vla-get-path x)))
        (not (tblsearch "BLOCK" b))
      )
      (vla-put-name x b)
    )
  )

  (princ)
)
« Last Edit: November 12, 2010, 11:51:31 AM by Lee Mac »

cmwade77

  • Swamp Rat
  • Posts: 1443
Re: Renaming XRefs
« Reply #6 on: November 12, 2010, 12:31:36 PM »
This could be a good starting point, once I figure out how it all works.....LOL....basically, I just have to figure out the mapping old filenames to new filenames portion I think now......like I said, a good starting point though, thank you.

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Re: Renaming XRefs
« Reply #7 on: November 12, 2010, 12:39:18 PM »
My 2¢ ... seems to me an improved work flow is in order, so that when a file comes in it is sanitized and then published (and renamed according to the project standards) to a folder (or folders) so that updates automagically and intelligently cascade through the system by virtue of the underlying file structure(s). Initial work to realize that end may involve programatically altering existing pathing.
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst

cmwade77

  • Swamp Rat
  • Posts: 1443
Re: Renaming XRefs
« Reply #8 on: November 12, 2010, 12:44:05 PM »
The problem is that many of our clients wouldn't accept that, so I am working it the other way around to address this issue.

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Re: Renaming XRefs
« Reply #9 on: November 12, 2010, 12:49:13 PM »
I humbly submit it sounds like your clients need to be educated. You are the CADD expert, they are coming to you for your expertise, it's an opportunity to demonstrate efficient and intelligent use of AutoCAD -- and leadership. I'd seize it. But hey what do I know, you're working and I'm unemployed, so I'll shadup.
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst

ronjonp

  • Needs a day job
  • Posts: 7527
Re: Renaming XRefs
« Reply #10 on: November 12, 2010, 01:10:45 PM »
I humbly submit it sounds like your clients need to be educated.
http://www.theswamp.org/index.php?topic=35702.msg409327#msg409327
Spot on  :-)

It's amazing how many routines we write to fix other peoples bad habits. :-(

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC

Lee Mac

  • Seagull
  • Posts: 12913
  • London, England
Re: Renaming XRefs
« Reply #11 on: November 12, 2010, 01:34:44 PM »

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Re: Renaming XRefs
« Reply #12 on: November 12, 2010, 01:36:20 PM »
exactly
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst

cmwade77

  • Swamp Rat
  • Posts: 1443
Re: Renaming XRefs
« Reply #13 on: November 12, 2010, 01:36:41 PM »
I humbly submit it sounds like your clients need to be educated.
http://www.theswamp.org/index.php?topic=35702.msg409327#msg409327
Spot on  :-)

It's amazing how many routines we write to fix other peoples bad habits. :-(
I know, but I only get so much control over how much we can educate our clients and some of them never quite get it, even when we do try to educate them.  

Maybe this would help: :pissed:

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Re: Renaming XRefs
« Reply #14 on: November 12, 2010, 01:44:38 PM »
When considering a "solution" it's good to consider the solution's (1) scalability [will it work on projects with 10, 100, 1000 drawings] (2) frequency [how many times will the "solution" have to be applied to the project as it progresses] (3) adaptability [is it adaptable to other projects, other clients) (4) and ultimately standardization [how do we do our work, regardless the client, recognizing what we turn over is not necessarily the same as interim products] ... yada ad infuckinitum.

But hey, if the client is willing to pay you the extra time required to work dumb AFTER you have attempted to enlighten them let them pay. :evil:
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst