Jump to content

Recommended Posts

Posted

Hello every body

I need to create table with Entmake.

Because I have a lot of data.

Thanks all.

 

Posted

Table is best done with vla-AddTable. Not saying it's impossible, but it's a lot easier that way.

  • Like 1
Posted

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)
)


 

Posted (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 by mstb
Posted

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.

Posted

Jonathon on the money had a table with like a 1000 rows took forever till using surpress.

Posted
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

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...