Author Topic: MLeader processing  (Read 1436 times)

0 Members and 1 Guest are viewing this topic.

BURGO80

  • Guest
MLeader processing
« on: December 18, 2014, 12:08:08 AM »
This takes about 2 seconds to process 22 MTexts
Code - C#: [Select]
  1. foreach (MText mt in MText)
  2.                 {
  3.                 foreach (KeyValuePair<string,string> pair in DrawingNumbers.List)
  4.                     {
  5.                     mt.Contents = mt.Contents.Replace(pair.Key, pair.Value);
  6.                     }
  7.                 }

This takes about a minute to process 22 MLeaders.
Code - C#: [Select]
  1. foreach (MLeader ml in Multileaders)
  2.                 {
  3.                 MText mt = ml.MText;
  4.  
  5.                 foreach (KeyValuePair<string, string> pair in DrawingNumbers.List)
  6.                     {
  7.                     mt.Contents = mt.Contents.Replace(pair.Key,pair.Value);
  8.                     ml.MText = mt;
  9.                     }
  10.                 }

If I take out the ml.MText = mt; it reduces back to 2 seconds (but my text won't change)

Does anyone know what's causing this?