Author Topic: Slow Table Cell Population  (Read 2657 times)

0 Members and 1 Guest are viewing this topic.

Rabbit

  • Guest
Slow Table Cell Population
« on: March 03, 2011, 02:55:39 PM »
I've got a snippet of code that I use to put in a default "0" into cells in a table.  The code works great, but, in larger tables with many rows, it takes for freakin' ever.  Any idea of how to speed it up any?

Code: [Select]
(setq *LE*ClearTAbleRowCount (- (vlax-get-property *LE*TableObject 'Rows) 2))
  (while (> *LE*ClearTAbleRowCount 2)
    (vla-SetCellTextStyle *LE*TableObject *LE*ClearTAbleRowCount *LE*TAbleColumnInsertCount "Hall_Table")
    (vla-SetCellAlignment *LE*TableObject *LE*ClearTAbleRowCount *LE*TAbleColumnInsertCount acMiddleCenter)
    (vla-SetText *LE*TableObject *LE*ClearTAbleRowCount *LE*TAbleColumnInsertCount 0)
    (vla-SetCellTextHeight *LE*TableObject *LE*ClearTAbleRowCount *LE*TAbleColumnInsertCount (/ (getvar "dimscale") 12))
    (setq *LE*ClearTAbleRowCount (1- *LE*ClearTAbleRowCount))
  );while

Sincerely,
Rabbit

jvillarreal

  • Bull Frog
  • Posts: 332
Re: Slow Table Cell Population
« Reply #1 on: March 03, 2011, 02:58:50 PM »
Look into vla-put-regeneratetablesuppressed

Rabbit

  • Guest
Re: Slow Table Cell Population
« Reply #2 on: March 03, 2011, 04:33:31 PM »
OH WOW!!!  I think I just had an orgasm.

Routine took from going about a minute and a half to about 5 seconds.

I have several routines that will have this in it now.

THANK YOU!!!!!!  It's amazing what's hard to find and yet so simple to implement.

Rabbit

Lee Mac

  • Seagull
  • Posts: 12929
  • London, England
Re: Slow Table Cell Population
« Reply #3 on: March 03, 2011, 04:48:41 PM »
OH WOW!!!  I think I just had an orgasm.

[cough] OOC thread [/cough]

mjfarrell

  • Seagull
  • Posts: 14444
  • Every Student their own Lesson
Re: Slow Table Cell Population
« Reply #4 on: March 03, 2011, 06:38:29 PM »
might I suggest that instead of Zeros that input a know bad value?  then you know the data is wrong.

something like ?___?, then everyone knows the information is missing
Be your Best


Michael Farrell
http://primeservicesglobal.com/