itacad Posted March 25 Posted March 25 Hi, I'm importing tables from excel pasting them as "autocad entities". Is there a way to make the row height and column width adjust to the text content? In excel it's a very trivial operation and the source excel table is formatted like this, I can't do the same operation in autocad. Regards Quote
itacad Posted March 25 Author Posted March 25 Sorry, in the meantime I found this discussion to be a solution Quote
BIGAL Posted March 25 Posted March 25 (edited) If you want to resize a column to suit the text one of the things you can do is look at all the values in that column and get the Strlen this is number of characters, you can then use the num+2 * textht * fuzzfactor for width. Before you do any widths you need to set Text height and Vert & Hor Cell margin. The margin is say * 0.5 textht. Another is you can read a Excel direct so get stuff like widths and text height and make the table to suit. Thats is how I would approach. Or I decide the values to be used then read the excel may want a different text height ta what is in Excel. So yes it is possible. So maybe start with reading cells from Excel. I have posted this many times, which has all the defuns you need to read Excel. So have a go. Same with make table example code. It has read column width. Saved latest version to downloads. Edited March 25 by BIGAL Quote
itacad Posted March 26 Author Posted March 26 Thanks, I will try to consider what you ask....for urgency the solution I found is sufficient, with further small adjustments by hand. I conclude considering that Autocad tables would be a very powerful tool, but their management is really not very "userfrindly" Quote
Recommended Posts
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.