Author Topic: Rotating the view becomes very slow due to transient texts  (Read 2391 times)

0 Members and 1 Guest are viewing this topic.

JohnSnow

  • Newt
  • Posts: 52
Rotating the view becomes very slow due to transient texts
« on: August 02, 2023, 08:27:45 PM »
Hi,
I have this code to generate transient texts. it is working but when I rotate the view in 3D. It gets very slow to finalise the view. I have replaced texts with circles and rotating is very smooth. Any chances that I can improve the performance for texts?
 

Code: [Select]
[CommandMethod("Test500")]
        public void Test500()
        {
            Document doc = Application.DocumentManager.MdiActiveDocument;
            using (Transaction transaction = doc.TransactionManager.StartTransaction())
            {
                for (int i = 0; i < 500; i++)
                {
                    MText acText = new MText();
                    acText.SetDatabaseDefaults();
                    acText.Contents = "Test";
                    acText.TextHeight = 0.5;
                    acText.Location = new Point3d(i, i, 0);
                    aGi.TransientManager.CurrentTransientManager.AddTransient(acText, aGi.TransientDrawingMode.Main, 128, new IntegerCollection());
                }
                transaction.Commit();
            }
        }
« Last Edit: August 02, 2023, 10:12:05 PM by JohnSnow »

Atook

  • Swamp Rat
  • Posts: 1029
  • AKA Tim
Re: Rotating the view becomes very slow due to transient texts
« Reply #1 on: August 02, 2023, 10:41:20 PM »
I know nothin' JohnSnow, but does an SHX font instead of a TTF font help?

kdub_nz

  • Mesozoic keyThumper
  • SuperMod
  • Water Moccasin
  • Posts: 2139
  • class keyThumper<T>:ILazy<T>
Re: Rotating the view becomes very slow due to transient texts
« Reply #2 on: August 02, 2023, 11:50:22 PM »
For transient texts, isn't 500 objects an unreasonably high quantity ??
Called Kerry in my other life
Retired; but they dragged me back in !

I live at UTC + 13.00

---
some people complain about loading the dishwasher.
Sometimes the question is more important than the answer.

JohnSnow

  • Newt
  • Posts: 52
Re: Rotating the view becomes very slow due to transient texts
« Reply #3 on: August 02, 2023, 11:57:05 PM »
I just tried shx and it does help! Thank you Atook.
@kdub_nz, that 500 is just for testing purposes.