PDA

View Full Version : Get Data From Xref'ed Fields



Richard McDonald
2007-08-10, 10:56 AM
I don't know if this is possible.

Does anybody know a way of extracting data from an xrefed table.

I have a table that calculates my drainage design levels and want to have it update the manhole schedules automatically.

MTIA

rkmcswain
2007-08-10, 11:56 AM
Yes, it's possible. But what exactly do you want to do?

Does the referenced table contain your drainage numbers?
Where is (and what type of data are) these manhole schedules?

Richard McDonald
2007-08-10, 01:06 PM
I have a table of field / formula to calculate the invert levels at manholes and with other fields referencing it for identification on the plan (Drawing 1).

I would like a separate drawing with the manhole schedules to reference this table for the invert levels co-ordinates etc (Drawing 2.

When I xref Drawing 1 into Drawing 2 the field generator will only see the table as an xref. I would like a field to show the data in say cell D3 in the schedule.

The reason for all this apparent effort for such a simple task is the design will be very mobile on this job and want the minimum of work when its updated.

zoomharis
2007-08-11, 08:52 AM
Yes, it's possible.
Look very eagerly forward to see how it's possible.

rkmcswain
2007-08-11, 01:12 PM
The "Yes" answer was specifically to this question.


Does anybody know a way of extracting data from an xrefed table.

You can extract data (in this example, the contents of a cell) from an xrefed table by doing this:
(cdr (assoc 1 (entget (car (nentsel)))))

zoomharis
2007-08-11, 01:40 PM
You can extract data (in this example, the contents of a cell) from an xrefed table by doing this:
(cdr (assoc 1 (entget (car (nentsel)))))
Yes. That's correct. Since this is AutoCAD Fields forum, I think this is not what the OP is looking for. He might be looking for some sort of field linking. That's what I expected too. Anyway, thanks for the lisp code.

rkmcswain
2007-08-12, 12:17 PM
...He might be looking for some sort of field linking.

True, but that wasn't clarified until the post after this one

zoomharis
2007-08-12, 02:16 PM
What makes this linking improbable is the way xref behave. Once it's attached, the object id of it's elements (Here the table) changes with each reload of the xref. Normally Object category of field uses this object id inside the field code. So, once the xref is reloaded, the linked field looses it's reference to the xrefed table. On the other hand, if it were a table inside a block, we could have accomplished the objective.

rkmcswain
2007-08-12, 02:53 PM
I have not tried it, but since 2008 can link both ways to an XLS file, in theory it should be possible for one DWG to update an XLS file, then let the XLS file update the second drawing, thereby making a quasi link of the tables....

Richard McDonald
2007-08-13, 07:36 AM
Unfortunately the powers that be have decided not to install 2008 because they don't think it has enough new features to warrant the effort. :screwy:

I will have to find a new way round it, doing everything in one drawing then xreffing the lot over. I may have been trying to be too complicated anyway.

Many thanks

Capt. Computer Crasher
2007-08-31, 12:42 PM
What makes this linking improbable is the way xref behave. Once it's attached, the object id of it's elements (Here the table) changes with each reload of the xref. Normally Object category of field uses this object id inside the field code. So, once the xref is reloaded, the linked field looses it's reference to the xrefed table. On the other hand, if it were a table inside a block, we could have accomplished the objective.

AutoCAD 2008 has added a .DXE file for the data extractor and has a way to use an existing one as a template which actually transfers the data from a table in one drawing to the another. So, instead of Xrefing the table, you can add the same table info into the other drawing and by editing the existing .DXE for that extraction you can update both tables at once.

Capt. Computer Crasher
2007-09-20, 01:08 PM
AutoCAD 2008 has added a .DXE file for the data extractor and has a way to use an existing one as a template which actually transfers the data from a table in one drawing to the another. So, instead of Xrefing the table, you can add the same table info into the other drawing and by editing the existing .DXE for that extraction you can update both tables at once.

To add to this Data Extractor in 2008 can also pull from X-refs.