Thank you in advance for your help,
I have a table, in cell D3 I have inserted a field containing a system variable. The contents of the cell looks like this,
%<\AcVar dimadec>%
I want to put in cell D2 the name of the vairable that is in cell D3 - I have tried the following,
%<\AcExpr (D3).ObjectName>%
%<\AcExpr (D3).textstring>%
Is there any way to reference the name of that system variable contained in cell D3? I want to do this to prevent errors by curious new users that may edit the table, I want the table to reference itself so that the system variable being read is always related to the correct system variable name.
Thanks again
Steve in Alaska
I have also tried
(vla-GetCellValue (%<\_ObjId 2130279344 (D,3)>%))
(vla-put-TextString(vla-GetCellValue (%<\AcExpr (D,3)>%)))
(vla-GetCellValue (%<\AcExpr (D,3)>%))
Steve in Alaska
Consider this just as an example
(setq ss (car (entsel "\n Select table:"))) (setq tbl (vlax-ename->vla-object ss)) (vla-settext tbl 2 3 "%<\\AcVar dimadec>%")
Tharwat
Thank you for such a quick reply, but I think you misunderstood,
%<\AcVar dimadec>% works just fine inside of a table cell, I want to remove the possibility of someone editing a cell next to the one that gets the system variable that describes what that system variable is. So in one cell is a text value "dimadec", the next one over is the set value of dimadec.
I have got the following to work most times, it produces "#" when the value is 0 or nil (this is working opposite of putting variable in one cell and reading name of it - this puts the name of variable in a cell and finds the value)
Put in table cell d2 - dimadec
Put in table cell d3 - (getvar d2)
So I tried a formulae in cell d3
=(if (= (getvar d2) "") "." (getvar d2))
But this returned the same "#" if the sytem value was 0 or nil
Steve in Alaska
Seems like you are going to a lot of effort to solve an employee problem. Training is the best solution.
Fields that access cell content will error unless the cell content is a number. There is no string manipulation or room for diesel in table cell formulas.
A fallback that would stop most casual employee errors would be to wrap the table into a block.
Hi,
You can set a cell to a locked state if you need a read only cell:
(vla-SetCellState MyTable row cell 2) will set to read only the cell at (row,cell), 2 is the Internal code for that state.
Gaston Nunez
Thank you for your advice,
I think designing a small table is not so much effort, much easier than going back and fixing something. The table that I am making has System Variables (fields) in one column, the requred settings in the next. An easy to use standards enforcer. Yes, I know there is a batch standards checker - again I feel that having the engineer or designer do it right from the start is better. This is a tool that they can use easy, and I don't have to worry about what they did to make the drawing pass the batch standards checker.
Steve in Alaska