Field expression within a field expression

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi,
If I add a field expression from the category AEC Database, and link to a excel sheet, I can copy this field expression:
%<\AecDb "DatabaseField" "*NONE*" "Provider=MSDASQL.1;Persist Security Info=False; Extended Properties=<">DBQ=C:\Users\REMILA\Desktop\TESTING_LINKING\PROJECT_DRAWING_LIST.xls; DefaultDir=C:\Users\REMILA\Desktop\TESTING_LINKING;Driver={Microsoft Excel Driver (*.xls)}; DriverId=790;FIL=excel 8.0;FILEDSN=C:\Users\REMILA\Documents\DataSource01.dsn;MaxBufferSize=2048; MaxScanRows=8;PageTimeout=5;ReadOnly=1;SafeTransactions=0;Threads=3;UID=admin;UserCommitSync=Yes; <">" "Sheet1$" "ID" "2" "SELECT [ID] FROM [Sheet1$]" "4" \f "%ut0%pu3%sc1%rv0%zl%zt">%
The "4" at the end of the formula is the actual row in the excel sheet to return the cell value from.
Now comes my question:
What can I do to replace this "4" with another field expression. At the moment I'm interested in replacing it with:
%<\AcVar ctab>%
This would return the name of the current layout tab. The idea would then be that the name of the layout would decide which row to get data from.
If replace "4" by %<\AcVar ctab>% in the code mentioned at the top, and put this in a text (mtext) in autocad, I get my correct value.
BUT as I understand it, the %<\AcVar ctab>% is now longer linked, and a new field expression (AEC Database) is basically created with a non-variable value for the row number.
What can I do to have my expression constantly linked to another variable?
I hope my question is understandble. Thanks in advance