Jump to content
rickhebert

Data Linking to Excel ok- Now how do I....

Recommended Posts

rickhebert

Hello and thanks for this great resource.

 

I have quite a number of tables data linked to Named Ranges in an excel spreadsheet.

 

But the spreadsheet name and server location changes, as is my company's policy to do, reflecting the project being worked on.

 

Is there a way to automate the process of renaming every data link in lieu of going to the data manager and re-linking every one of them individually?

 

In other words, I would like to specify the new name and location of the spreadsheet and have it update all the links accordingly.

 

Can this be done?

 

TIA-

Share this post


Link to post
Share on other sites
rickhebert

I found a solution to my problem.

 

Create a Unique folder named specifically to the project.

 

Using Relative Path option in Data Link Manager and naming the Excel spreadsheet identical every time, and just storing the drawing and the spreadsheet in that folder.

 

So each project will have a unique folder with a unique ACAD drawing linked relative to a spreadsheet with the same name in that folder but with different data in it.

 

The tables in the drawing maintain their layout format and update when you use the Datalink Update menu

 

Voila!

Share this post


Link to post
Share on other sites
dbroada

glad you are sorted. I have a similar problem with people renaming/moving folders for their own good without thought for anybody else. I was going to suggest using a relative path option for you but I couldn't find one in my datalink manager.

Share this post


Link to post
Share on other sites
rickhebert

I see,

 

What ver ACAD are you working with?

 

My company is using 2011, and I found it when you right click on a data link thats been previously created and choose "EDIT"

 

or

 

When you create a new datalink, it is the option just under where you choose the path called "Path Type"

 

It is the same dialog box for either

 

You get to choose one of three otions in "Path Type";

1) Full Path

2) Relative Path

3) None

 

I see how Full and Relative could be used, but I haven't a clue what "None" might be used for!

 

Have a great day

Share this post


Link to post
Share on other sites
MarkytheSparky

Is there anyway to automate the renaming of the file itself? My company changes the name of the file from time to time... ExcelFile-REVA.xls, ExcelFile-REV-B.xls...

 

There has to be a way to automate the name change - the datalinks are stored in a dictionary file for the drawing...

 

This code lets you list out the Datalinks

 

(defun c:ListDictionaries ( / ed ed1)

(_> (prompt "\nDictionaries in current drawing: ")

(_> (foreach ed (entget (namedobjdict))

((_> (progn

(((_> (cond ((= (car ed) 3)

(((((_> (prompt (strcat "\n" (cdr ed))))

((((_> ((= (car ed) 350)

(((((_> (progn

((((((_> (foreach ed1 (entget (cdr ed))

(((((((_> (if (= (car ed1) 3)

((((((((_> (prompt (strcat "\n " (cdr ed1)))

((((((((_> )

(((((((_> )

((((((_> ))

((((_> )

(((_> )

((_> )

(_> (princ)

(_> )

 

 

But how do you change the name of the file if the Cell References do not change from REV to REV?

 

SO CLOSE BUT SO FAR AWAY

Share this post


Link to post
Share on other sites
SLW210

Please read the Code Posting Guidelines and have your Code to be included in Code Tags.[NOPARSE]

Your Code Here[/NOPARSE]

=

Your Code Here

Share this post


Link to post
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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  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...