I've got this posted at AUGI, but I was hoping someone here might be able to help out as well. below is a program that I have that checks the scale of a selection set of blocks, if it isnt right, it changes it. however, the program is very slow when it runs - it takes about 6 seconds to correct 3000 blocks. i'd like to reduce this to almost instant, if it is even possible. Does anyone have an suggestion on how to make this run faster?
(defun c:setblock1
(/ annoscale blockent blockentdata blockset blockvla count)
(setq annoscale (vl-string-left-trim "1" (getvar "cannoscale"))
annoscale (atoi (vl-string-left-trim ":" annoscale))
) ;_ end of setq
(if (setq blockset
(ssget
"x"
(list
'(-4 . "<AND")
'(0 . "INSERT")
'(2
.
"ANT,DOT,BP,BUSH,CB,CI,CIRP,CO,CRB,DF,EMF,EMH,EMT,EO,ETR,FH,FNP,FOP,FP,GL,GM,GMF,GMP,GP,GUY,GV,HH,LP,MAJORTIC,MINORTIC,MB,MH,MW,OP,PH,PN,PP,RP,SAMH,SAT1,SB,SC,SCB,PLUS,SGN,SPG,SPH,ST,STMH,TMF,TMH,TP,TR,TRB,TSCB,VLT,WELL,WET,WLF,WM,WMH,WSO,WV,YDL,YP"
)
'(-4 . "<NOT")
(cons '41 annoscale)
'(-4 . "NOT>")
'(-4 . "AND>")
) ;_ end of list
) ;_ end of ssget
) ;_ end of setq
(progn
(setq count 0
) ;_ end of setq
(while (< count (sslength blockset))
(setq blockent (ssname blockset count)
blockvla (vlax-ename->vla-object blockent)
) ;_ end of setq
(if (wcmatch (vla-get-name blockvla)
"MAJORTIC,MINORTIC"
) ;_ end of wcmatch
(progn
(vla-put-xscalefactor blockvla 1.0)
(vla-put-yscalefactor blockvla 1.0)
(vla-put-zscalefactor blockvla 1.0)
) ;_ end of progn
(progn
(vla-put-xscalefactor blockvla (/ 1.0 annoscale))
(vla-put-yscalefactor blockvla (/ 1.0 annoscale))
(vla-put-zscalefactor blockvla (/ 1.0 annoscale))
) ;_ end of progn
) ;_ end of if
(setq count (1+ count))
) ;_ end of while
(placeattrib blockset annoscale)
(vla-regen (vla-get-activedocument (vlax-get-acad-object))
acAllViewports
) ;_ end of vla-regen
) ;_ end of progn
) ;_ end of if
) ;_ end of defun
Thanks,