Despite advice received elsewhere, I have been unsuccessful in my attempt to clone
Paul Connelly wrote: Given your stated goal, CloneAsSeed() is what you want.
I'm struggling. Here's a C# method that is supposed to clone a table seed...
TextTable TextTableFromSeed(DgnModel tableSeedModel, DgnModel activeModel, int nRows, int nCols, DgnTextStyle activeTextStyle) { TextTable textTable = null; double textHeight = 1.0; activeTextStyle.GetProperty(TextStyleProperty.Height, out textHeight); if (null != tableSeedModel) { TextTable seed = TextTable.Create((uint)nRows, (uint)nCols, activeTextStyle.Id, textHeight, tableSeedModel); System.Diagnostics.Debug.Assert(null != seed, "TextTable.Create from tableSeedModel failed"); textTable = seed.CloneAsSeed((uint)nRows, (uint)nCols, activeModel); System.Diagnostics.Debug.Assert(null != textTable, "TextTable.CloneAsSeed failed"); string s = $"Created table from seed model '{tableSeedModel.ModelName}'"; MessageCenter.Instance.ShowMessage(MessageType.Info, s, s, MessageAlert.Balloon); } return textTable; }
The method executes successfully, but the resulting TextTable symbology doesn't match the table seed in the DGNLib.
TextTable
I modified the SDK example. When it starts, it searches for table seeds in DGNLibs, uses the first it finds, then calls the above method. Apart from that, the functionality is unchanged.
4606.ManagedTextTableExample.zip
Jon Summers said:I have been unsuccessful in my attempt to clone a TextTable
The problem is solved!
You can read about it in this article about TextTables and .NET. The articles contain a link to a downloadable C# TextTableHelper class.
TextTableHelper
If you're writing C++, then there's an equivalent set of articles and C++ TextTableHelper class.
Regards, Jon Summers LA Solutions
Answer Verified By: Jon Summers