AVAX-software.com Forums: Change Color: faster Methode? - AVAX-software.com Forums

Jump to content

Page 1 of 1

Change Color: faster Methode?

#1 User is offline   MarioRainer Icon

  • Advanced Member
  • PipPipPip
  • Group: Members
  • Posts: 43
  • Joined: 11-May 08
  • Location:Germany

Posted 11 May 2008 - 04:26 PM

Hello
gives to change it a method around very fast the colors? I imported a drawing (dwg file) and the function: Change color tested.
With 600 objects in the drawing the function needs more then 5 minutes, which much is to long ones.
Is there fast method here?
Yours sincerely

Mario Rainer
Private Sub Command1_Click()
Dim I As Long
Dim h() As Long
Dim s As Variant
Dim e As Variant
Dim fOk
Dim lngZeitDiff As Long
    
    cAvax1.ContinueUndo = False
    s = Now
    For I = 1 To cAvax1.MaxItems
        ReDim h(1) As Long
        h(1) = I
        fOk = cAvax1.ChangeColor(h(), 1)
    Next
    e = Now
    
    cAvax1.ContinueUndo = True
    
    lngZeitDiff = DateDiff("s", s, e)
    
    
    MsgBox "Time: " + CStr(DateAdd("s", lngZeitDiff, 0)) + " Objects: " + CStr(I - 1)
    
    
End Sub


#2 User is offline   Athanasios Gardos Icon

  • Administrator
  • Icon
  • Group: Admin
  • Posts: 333
  • Joined: 21-March 05
  • Gender:Male

Posted 12 May 2008 - 11:12 AM

Hi,

You can use the following code:
Dim h() As Long, lMax As Long
lMax = cAvax1.GetAllHandlesArr(h())
Call cAvax1.ChangeColor(h(), 1)

Athanasios Gardos
Avax-Software.com

Page 1 of 1


Fast Reply

  

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users