aloy Posted October 21, 2016 Share Posted October 21, 2016 Hi everyone, I have a list with sub lists each containing 18 elements. When the sublists are many say 25, the formation of table take about 20 seconds with the following code: (setq row 2) (setq cell 0) (if lst (while lst (setq lstx(car lst)) (while (<= cell 17) (vla-settext myTable row cell (car lstx)) (vla-setCellAlignment myTable row cell acMiddleCenter) (setq lstx(cdr lstx)) (setq cell (+ 1 cell)) ) (setq lst(cdr lst)) (setq row(1+ row)) (setq cell 0) ) ) Row 0 is the title and 1 contains the headings of columns. Can this be speeded up by lambda functions and if so how?. Thanking in advance. Aloy Quote Link to comment Share on other sites More sharing options...
Tharwat Posted October 21, 2016 Share Posted October 21, 2016 Hi, lambda function can not speed up codes but in your case you can use the function vla-put-regeneratetablesuppressed to speed up the creation of your acad_table object. Quote Link to comment Share on other sites More sharing options...
aloy Posted October 21, 2016 Author Share Posted October 21, 2016 Thanks Tharwat. Now less than one second. Aloy Quote Link to comment Share on other sites More sharing options...
BIGAL Posted October 21, 2016 Share Posted October 21, 2016 It may be this that is slowing it down (vla-setCellAlignment myTable row cell acMiddleCenter) setting column to acmiddlecenter not something I have had to do. I did 88 rows and is splat done. Quote Link to comment Share on other sites More sharing options...
aloy Posted October 22, 2016 Author Share Posted October 22, 2016 Yes, that is true. It works as fast as with 'regeneratetablesuppressed' option when the formatting is suppressed. There is no worry about the formatting as I am going to export it to Excel where I can do all that. Thanks BIGAL. Aloy Quote Link to comment Share on other sites More sharing options...
Tharwat Posted October 22, 2016 Share Posted October 22, 2016 Thanks Tharwat. Now less than one second. Aloy You are welcome. Quote Link to comment Share on other sites More sharing options...
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.