Hi @paullimapa , thanks for your response.
I want to have a field outside the table and this field shows the value of table cell.
then you'll need this add-on which is not free:
How to link / insert a table cell to AutoCAD fields. - YouTube
How can I link a field to a table cell content?
Assuming your table cell content is numeric:
AutoCAD fields prevent this from working on non-numeric content. Some might call it a design limitation; some call it a very mature bug.
If you're willing to use a LISP command, this might work for you.
;;Basic demonstration of linking a table cell to a field
;;No error checking, no guarantees. Seems to work. Creates a text object.
;;D. C. Broad, Jr. 4/17/2023
(defun c:fieldcell (/ textent textobj oid)
(if
(and
(setq textent (car (nentsel "\nSelect table cell")))
(setq textobj (vlax-ename->vla-object textent))
(setq oid (vla-get-objectid textobj))
)
(command "_.text"
pause
""
""
(strcat "%<\\AcObjProp Object(%<\\_ObjId "
(itoa oid)
">%).TextString>%"
)
""
)
)
(princ)
)
@farzanbayat74 wrote
<<...I want to have a field outside the table and this field shows the value of table cell....>>
Use MTEXT to display the value of the cell.
Start mtext command=>>Right-click=>>Insert Field=>>then do this:
Chicagolooper
If you're willing to use a LISP command, this might work for you.
(nentsel "\nSelect table cell")
This portion does not appear to work when the cell font is truetype, unless the drawings VisualStyle is set to "Realistic". Cells using SHX fonts always seem to work.
Found the same problem in the .NET GetEntity, GetNestedEntity.
That seems about right with AutoCAD. It's always something. Just when you think it works right, it doesn't.
So some eager beaver could add on by 1)Using hittest to determine which row and column is selected, 2)Get the celltextstyle for that cell, 3)determine whether that style is SHX 4)if so, do fieldcell, 5)otherwise create a temporary text style with an shx font, 6)temporary set the celltextstyle for that cell, 7)do the function fieldcell actions, 8)set the celltextstyle back to whatever it was, 9)delete the temporary text style.
So some eager beaver could add on by ....
I had a different train of thought, added an option to our ToolPac Table SubSelection tools so the user can simply swipe across the cells they want to create linked mtext from and click a button. It instantly creates all the fields in the current layer so the user can then simply drag them to the desired locations.
Could be used in combination with a linked table from Excel, etc.
Thanks @TerryDotson , It worked. easy and no need for lisps 👍
Hi,
Is it possible to get the cell's value without what is before the cell's value?
{\fAptos Narrow|b0|i0|c0;2024-05-29
Would like it to look like this: 2024-05-29
Thanks in advance!
Olov
@olov_backlund schrieb:
the cell's value without what is before the cell's value?
Hi,
don't use internal Mtext formattings (your sample: Overrided Font for example)
but yes, it is also possible to by a change of your fieldcode:
HTH
Sebastian
Hi,
Thanks for the help. Is it possible to force the cell value to be in uppercase?
/Olov
But it can link cell value to text
Hi,
It is possible to merge two or more cell values with a space between them?
And is it possible to add these fields to a block?
/Olov