[CONNECT .NET] Create TextTable from Seed part 2

Despite advice received elsewhere, I have been unsuccessful in my attempt to clone

 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.

Updated ManagedTextTableExample

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

Parents Reply Children
No Data