mstb Posted July 2, 2020 Posted July 2, 2020 Hello every body I need to create table with Entmake. Because I have a lot of data. Thanks all. Quote
Jonathan Handojo Posted July 2, 2020 Posted July 2, 2020 Table is best done with vla-AddTable. Not saying it's impossible, but it's a lot easier that way. 1 Quote
BIGAL Posted July 3, 2020 Posted July 3, 2020 mstb are you suing a Mac or other software ? Bricscad and Autocad use Vl-addtable like Jonathan suggested. ; make table example ; By Alan H info@alanh.com.au ; 2018 (defun c:ahmaketable (/ colwidth numcolumns numrows objtable rowheight sp vgad vgao vgms) (vl-load-com) (setq sp (vlax-3d-point (getpoint "pick a point for table"))) (Setq vgms (vla-get-modelspace (vla-get-activedocument (vlax-get-acad-object)))) ; (setq numrows 5) (setq numcolumns 5) (setq rowheight 2.5) (setq colwidth 60) (setq objtable (vla-addtable vgms sp numrows numcolumns rowheight colwidth)) (vla-settext objtable 0 0 "DRAWING REGISTER"); TABLE TITLE (vla-settext objtable 1 0 "DRAWING NUMBER") (vla-settext objtable 1 1 "DRAWING TITLE") (vla-settext objtable 1 2 "C") (vla-settext objtable 1 3 "D") (vla-settext objtable 1 4 "E") (vla-settext objtable 2 0 "1") (vla-settext objtable 3 0 "2") (vla-settext objtable 4 0 "3") (command "_zoom" "e") (princ) ) Quote
mstb Posted July 3, 2020 Author Posted July 3, 2020 (edited) 18 hours ago, Jonathan Handojo said: Table is best done with vla-AddTable. Not saying it's impossible, but it's a lot easier that way. 1 hour ago, BIGAL said: mstb are you suing a Mac or other software ? Bricscad and Autocad use Vl-addtable like Jonathan suggested. ; make table example ; By Alan H info@alanh.com.au ; 2018 (defun c:ahmaketable (/ colwidth numcolumns numrows objtable rowheight sp vgad vgao vgms) (vl-load-com) (setq sp (vlax-3d-point (getpoint "pick a point for table"))) (Setq vgms (vla-get-modelspace (vla-get-activedocument (vlax-get-acad-object)))) ; (setq numrows 5) (setq numcolumns 5) (setq rowheight 2.5) (setq colwidth 60) (setq objtable (vla-addtable vgms sp numrows numcolumns rowheight colwidth)) (vla-settext objtable 0 0 "DRAWING REGISTER"); TABLE TITLE (vla-settext objtable 1 0 "DRAWING NUMBER") (vla-settext objtable 1 1 "DRAWING TITLE") (vla-settext objtable 1 2 "C") (vla-settext objtable 1 3 "D") (vla-settext objtable 1 4 "E") (vla-settext objtable 2 0 "1") (vla-settext objtable 3 0 "2") (vla-settext objtable 4 0 "3") (command "_zoom" "e") (princ) ) Thanks . But when data is too long, the table is slow and usually takes a few minutes . Maybe I shoud change a system variable?!. Or There is faster way? Edited July 3, 2020 by mstb Quote
Jonathan Handojo Posted July 3, 2020 Posted July 3, 2020 Ah, you need to set vla-put-RegenerateTableSurpressed to :vlax-true, put all your data in, and at the end, set it back to :vlax-false to regenerate and display the data. What happens with vla-SetText with every cell you iterate through is that AutoCAD opens the cell, puts the data in, closes the cell, and regenerates it to display the text. So you can temporarily set vla-put-RegenerateTableSurpressed to :vlax-true at the start, set all your texts, and finally set vla-put-RegenerateTableSurpressed to :vlax-false to display the data. Quote
BIGAL Posted July 4, 2020 Posted July 4, 2020 Jonathon on the money had a table with like a 1000 rows took forever till using surpress. Quote
mstb Posted July 4, 2020 Author Posted July 4, 2020 On 7/3/2020 at 2:29 PM, Jonathan Handojo said: Ah, you need to set vla-put-RegenerateTableSurpressed to :vlax-true, put all your data in, and at the end, set it back to :vlax-false to regenerate and display the data. What happens with vla-SetText with every cell you iterate through is that AutoCAD opens the cell, puts the data in, closes the cell, and regenerates it to display the text. So you can temporarily set vla-put-RegenerateTableSurpressed to :vlax-true at the start, set all your texts, and finally set vla-put-RegenerateTableSurpressed to :vlax-false to display the data. 15 hours ago, BIGAL said: Jonathon on the money had a table with like a 1000 rows took forever till using surpress. tHANK YOU VERY MUCH 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.