How do we use .NET method TextTable.CloneAsSeed? It's non-static, so we must first create a table. Looks like a chicken-and-egg situation.
TextTable.CloneAsSeed
For example, you have a TextTable with 4X4 cells then you can use CloneAsSeed to create a 5X5 cells TextTable.
Hi Jon Summers,
Extending a little bit on what Yongan provided...
The TextTable Create and CloneAsSeed methods are used to create a "layout" (in memory instance) vs. final "presentation".Here is a code snip providing a couple quick example tests:
//Create w/nul and valid model TextTable textTable1 = TextTable.Create(4, 4, style.Id, 1000.0, null); TextTable textTable2 = TextTable.Create(4, 4, style.Id, 1000.0, model); //Create via CloneAsSeed w/nul and valid model TextTable textTable3 = textTable2.CloneAsSeed(5, 5, null); TextTable textTable4 = textTable2.CloneAsSeed(5, 5, model);
HTH,Bob
Answer Verified By: Jon Summers
Robert Hook said:Here is a code snip...
Yongan.Fu said:For example, you have a TextTable...
Thanks! But how does one obtain the DGN model in your example lines #3 and #7?
Regards, Jon Summers LA Solutions
The TextTable is written to a given DesignFile's "DefaultModel" that can be obtained from the DgnFile.DefaultModelId - Assigned, or Created via SeedCopyFlags.CreateDefaultModel.
Unfortunately at this time .NET does not provide a more common GetDefaultModel() method that both MDL (same method name) and VBA/COM interop (DefaultModelReference) APIs provide.
Robert Hook said:The TextTable is written to a given DesignFile's "DefaultModel"
You've lost me!
My goal is this:
My original question may be ill-formed because I am confused about the API. There are several methods concerning table creation, and I'm hoping to clarify in my mind what they do...
Hi Jon,
- CloneAsSeed() produces a copy of a TextTable inheriting the symbology but not the contents of the seed.
- Copy() produces a complete copy of the TextTable (including contents), with units, levels, etc possibly remapped into the context of a different model.
- Create() produces a brand-new TextTable without using a seed.
Given your stated goal, CloneAsSeed() is what you want.
The problem is solved! I've published a solution along with a TextTableHelper class.
TextTableHelper