Jump to content

Updating drawings to changed xref name


Recommended Posts

Hello All


I have looked around the webfor different web pages for acad and foun this and it looks like a lot of you know what you are talking about - hopefully someone might be able to help me with the following

..hopefully it is not too much of a ask ?


At my work we organise jobs in the following format


year job number

eg 08555

All work is done within that job numbr


We oraginse our work in folders within that job number

For Developement Approval the works are with a DA folder


Our drawings are in the following format 08555_DA_C001

Thats job number_stage_drawing number


Our xrefs are in the format XR08555_DA_SURVEY

thats XRjobnumber_stage_xref name


Now when we go from DA stage to CC as a start we simply copy the DA folder and paste and rename to CC this has all the contents of th DA folder so drawings are still 08555_DA_C001 etc and xrefs are still named XR08555_DA_SURVEY etc.


We simply replace the DA ith CC in the drawing name.


What id like to do is the following

Run a command within the newly renamed CC drawing that currently has all the DA xrefs that changes the names of the xrefs from XR08555_DA_SURVEY to XR08555_CC_SURVEY d rereferences the new renamed xref in CC folder.


This is to keep all of the current XREF settings without detaching and reattching.


I currently do this manually by doing the following


Copy DA folder and paste and rename to CC

Rename all drawings and xrefs by replacing the DA with CC


Open first drawing that has xrefs in it - use the 'rename' command and search in blocks for the xref in format XR08555_DA_SURVEY and rename this block to XR08555_CC_SURVEY.


Then open xref manager - reload the XR08555_DA_SURVEY xref which updates to the new name of XR08555_CC_SURVEY.

But the xref is still refrenced to the XR08555_DA_SURVEY.




Then unload the xref XR08555_CC_SURVEY(not detach)


Then attach a new xref - attach the new xref from the CC folder that has been copied and renamed from the DA folder to XR08555_CC_SURVEY.


Then reload the xref XR08555_CC_SURVEY and woolaa the survey path and name is changed and has kept all the original layer settings within the drawing etc.


Would it be possible to create a lisp to do this? like a tblsearch for a xref named in the order of XR08555_DA_SURVEY and rename it to XR08555_CC_SURVEY.

Then 1 reload the xref to accept the name change

2 unload the xref

3 attach a new xref named the same and in the current drawig folder

4 reload the xref.


Done updated drawings with all xref stages changed.

And has kept all of the oriinal xref settings within that drawing which is most important.


I know this is a massive ask for my first post.


By the way i know a little bit about lisp but this is way past my ability.

Hopefully someone can help..



Thank you guys

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...