TheSwamp
Code Red => .NET => Topic started by: JohnSnow 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?
[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();
}
}
-
I know nothin' JohnSnow, but does an SHX font instead of a TTF font help?
-
For transient texts, isn't 500 objects an unreasonably high quantity ??
-
I just tried shx and it does help! Thank you Atook.
@kdub_nz, that 500 is just for testing purposes.