Message 1 of 7
tab when the text has a different size

Not applicable
03-31-2021
10:31 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello,
I want to insert a Text, I almost succeeded in doing so, but since sometimes my text is a different size, they don't line up.
I enclose what I have, as well as my code
[CommandMethod("TABULATION")]
public static void Tab()
{
CommandTemplates.ActionCall((Document doc, Editor ed, Database db, Transaction tr) =>
{
Dictionary<string, int> ItemList = new Dictionary<string, int>();
var T1 = new Dictionary<string, string>()
{
["ALPHA"] = "1",
["BETA"] = "2",
["OMEGA"] = "3"
};
var T2 = new Dictionary<string, string>()
{
["ALPHA"] = "aaaaaaaaaaaaaaaaaaaaaaaaaa",
["BETA"] = "bbbbbbbb",
["OMEGA"] = "ccc"
};
var T3 = new Dictionary<string, string>()
{
["ALPHA"] = "they are not in the same colone",
["BETA"] = "they are not in the same colone",
["OMEGA"] = "they are not in the same colone"
};
var mtext = new MText();
mtext.Contents = string.Join("\\P", T1.Select(pair => pair.Key + "\t"+ T2[pair.Key] + "\t" + T3[pair.Key]));
var A = mtext.Contents.ToString();
CreateMText(A, ed);
});
}