Crainiate Community

Support and discussion for users of Crainiate component software products
Welcome to Crainiate Community Sign in | Join | Help
in Search

model.clear() takes 3-4 seconds?

Last post 09-01-2008 11:20 PM by johnmac. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 08-29-2008 6:39 PM

    model.clear() takes 3-4 seconds?

     Hello

     Before rebuilding my diagram I need to clear the current shapes and lines.

    So I tried the layer.removeshapes/removelines which does nothing (as far as I can see).

    so now I am trying the model.clear() which does work....

    however it takes 3-4 seconds regardless of the complexity of the diagram.

    this is rather worrying..as I am already facing a performance problem with the build routine.

    actually the clear() method is now taking as long as the build...

     any help would be appreciated.

    thanks

    Filed under:
    • 164.144.248.25
  • 09-01-2008 1:55 PM In reply to

    Re: model.clear() takes 3-4 seconds?

    Hi John,

    The Layer.RemoveShapes/Lines methods are used to move elements between layers, they do not remove elements from the diagram itself. These functions are called internally when the diagram is cleared.

    When talking about the Build routine, can I assume this is the insertion and shapes and lines into a diagram, and not the Visual Studio build?

    You should always Suspend and Resume the diagram before inserting elements, otherwise each change is rendered and this can impact performance. You should suspend the UndoList unless you actually plan to use undo/redo, this can consume memory, usually performance issues are related to.net having to allocate more memory.

    Finally, do you load data from a database, attach to any events etc, this could be causing long running items. A code profiler (such as ones available from Red Gate) can identify these issues.

    Filed under:
    • 86.147.176.127
  • 09-01-2008 11:20 PM In reply to

    Re: model.clear() takes 3-4 seconds?

     hi james

     ok - i understand that the removeshapes/lines is not going to help.

     yes, for build i mean my routine...not visual studio.

    i do use suspend/resume which makes a big difference but i didn't  try the undo list...which might

    explain the increasing time delay.

     

    thanks

    • 75.109.178.174
Page 1 of 1 (3 items)