Jump to content

Datalinks and Attributes combination through LISP?


Magnum Z

Recommended Posts

So I looked around a little bit, but I didn't see much on the subject. I was wondering if you could use the datalink utility in 2009 to update block attributes via Excel using LISP or other means through AutoCAD only. I'm aware of 3rd party utilities that do this for a price, but I don't think it relys solely on AutoCAD's programming. Also aware of ATTOUT/IN.

 

It's been a while since using AutoLISP in College and I'm sure it's improved a bit as well.

 

Any ideas or info regarding this would be much appreciated.

 

Thanks.

Link to comment
Share on other sites

Not especially, but I have a work around in the mean time with ATTOUT/IN. Nothing pretty, but I'm going to keep looking around. I've seen several people claim that attributes can be update via a table in AutoCAD that's connected to Excel through a data link. I haven't clearly found out how that's possible quite yet.

 

Just have to find the right search criteria I guess.

 

Still if anyone here has that information and would like to explain it to me, I'm more than willing to learn.

Link to comment
Share on other sites

  • 2 weeks later...

Ok, I'm at a bit of a loss.

 

I have figured out how to link an extracted attribute data table in AutoCAD to a table in Excel. Problem is when I edit said Excel file it only updates the "External" columns that appear in the AutoCAD table and not the Attribute columns themselves which means the blocks the data came from are also not getting updated. Also when the blocks are updated the Attribute columns are updated, but the external ones are not. Write Data Links seems to fail and will not write to the Excel file.

 

Now I've read several places now where people claim to be able to link the Excel data to the Attribute data, but I'm not finding it with the above method.

 

I understand there's plenty of power through VBA and/or AutoLisp to possibly do this very job, but again I'm just not sure how to go about it. Don't have any experience with VBA, and as I said before I remember very little from my AutoLisp days in college.

 

 

What I'm trying to accomplish:

Update separate blocks' attributes edited within the drawing to an Excel file, as well as editing the same attribute "list" in Excel to update the blocks' attributes in the AutoCAD drawing.

 

ATTOUT/IN can be used as I've already done so, but I'm trying to streamline the process to make it usable for someone that can just edit the spreadsheet or blocks themselves, push an update button, and have both sources of data updated to the same thing.

 

If there is anyone, ANYONE, that can help even just a little, I would be most grateful. I'm not looking for someone to do all the work for me, just point me to some good solid facts about how to go about doing this using the resources available to me now.

 

Thanks,

Magnum

Link to comment
Share on other sites

Providing your blocks have some form of unique Id you should be able to go both ways fairly easy.

 

As an example you would need "block name" then a unique Id/attribute value "part No" you can look through a drawing fairly fast and probably update all blocks to match spreadsheet and reverse this to update excell. You could save the autocad entity identification which is an individual value for every object in an AutocadDWG.

 

You could tag in your excell the lines to be updated once updated then they are untagged. This means only blocks that need to be updated are changed. In autocad update excell as you update block.

 

There is a lot of info here about talking to and from excell as well as editing attributes within blocks the hard part is joining it all together.

Link to comment
Share on other sites

Started looking into DBConnect. If I have to go that route I will, but from the looks of it that may be just as complicated as the ATTOUT/IN for my supervisor, but possibly doable.

 

The blocks I'm working with are Valve symbols and our ID system requires each valve to have a different ID. We have a spreedsheet that hasn't been up to date for a rather long time. While I work on the drawings, I'd like the spreedsheet to be update along with that info I put into the drawings. Then someone such as Maintenance or my supervisor could also change info in the spreedsheet to be reflected in the drawing when updated.

 

I've been able to link the data of the two ID columns using the data link app. As I outlined before, I've found no clear explanation as to how the rest of the data is linked together from there. The data extract/link app. seems to create two columns of each attribute. One linked to the drawing, and another linked to the external data.

 

So say I have the attribute "ID" as "V-3120". It also has a "Size" attribute. When extracted using data extraction and linked to a Excel sheet with an "ID" column and data values matched with "V-3120", the extraction table makes two "Size" columns. "Size" which represents the in drawing attribute data, and "Size - (External)" which represents the data in the Excel file.

 

I've looked around the site a couple different times. Used the search function in numerous ways(this isn't the first forum I've been to with a search engine like the one used here). I've found no difinitive answer on what needs to be done further(if anything). Beyond linking the data manually to each cell needed, I don't know what I'm doing wrong.

 

I did find this link in another thread. Sounds like it would do the trick with a bit of tweeking, but I'll probably still need a little insight into it's code. Perhaps with a little help, I can improve it to what I need it for.

Link to comment
Share on other sites

  • 1 year later...

I hope this helps,

 

===========================================================

DATALINKS

 

Tools > Data Links > Data Link Manager

 

Click Create a new Excel Data Link

 

 

Click [OK], and browse to the excel file you want to link its data to your autocad table by clicking the button next to the input box “Choose an Excel file:”

 

In the “Select Excel sheet to link to”, select the desired sheet,

 

Then check the radio, “Link to range” and type in the desired range as shown below

 

Click the Arrow next to the [Help] Button (bottom right)

 

 

In the “Cell Formatting” uncheck the box “Use Excel formating”

 

 

(Note. You may ask why we don’t use the Excel formating. The answer is

Without using the Excel formating you need to resize the table to what you like only once when you insert it into your drawing.

 

Using the Excel formating, you still have to resize the table when you insert it into the drawing plus everytime you update the data link the table will be automatically resized to match the Excel and you have to resize it to your taste again.

 

Click [OK]

 

Click [OK]

 

TABLE

COMMAND > TABLE and Select the radio “From a data link”

 

Then in the input field, select the desired data link

 

 

Click [OK] to insert the table

Size the table to your taste (you’d better setup some anchor points prior to this step.

Anytime you change the linked Excel file, you just need to update Data link for your table.

 

 

===========================================================

 

 

Sorry, but the pictures embeded in my doc get lost when pasted here. I hope following the text you still can figure out what to do.

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.

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