C3D-0301 · 260610 Tara Blvd: text styles + what the store labels use done
READ-ONLY. Lists every text style with its font file/TTF, then every store label with its current style, entity type (DBText vs MText) and layer, to plan the TXT2MTXT conversion to Arial.
C# payload
// What Arial text styles exist, and what style does the store text currently use?
var tst = (TextStyleTable)Tx.GetObject(Db.TextStyleTableId, OpenMode.ForRead);
Log("=== TEXT STYLES ===");
foreach (ObjectId id in tst) {
var ts = (TextStyleTableRecord)Tx.GetObject(id, OpenMode.ForRead);
string tt="";
try { tt = string.IsNullOrEmpty(ts.Font.TypeFace) ? "" : " TTF=\""+ts.Font.TypeFace+"\""; } catch {}
Log(string.Format("{0,-24} file={1,-24} h={2:F3} w={3:F3}{4}", ts.Name, ts.FileName, ts.TextSize, ts.XScale, tt));
}
Log("");
Log("=== STORE TEXT: current style + type ===");
var ms = (BlockTableRecord)Tx.GetObject(SymbolUtilityServices.GetBlockModelSpaceId(Db), OpenMode.ForRead);
int dbt=0, mt=0;
foreach (ObjectId id in ms) {
var ent = Tx.GetObject(id, OpenMode.ForRead) as Autodesk.AutoCAD.DatabaseServices.Entity;
if (ent == null) continue;
var d = ent as DBText; var m = ent as MText;
if (d == null && m == null) continue;
var e = ent.GeometricExtents;
if (e.MinPoint.X < 2261060 || e.MinPoint.X > 2261110) continue;
ObjectId sid = d != null ? d.TextStyleId : m.TextStyleId;
var st = (TextStyleTableRecord)Tx.GetObject(sid, OpenMode.ForRead);
string txt = d != null ? d.TextString : m.Contents;
if (d != null) dbt++; else mt++;
Log(string.Format("[{0}] {1,-6} style={2,-14} layer={3,-12} \"{4}\"",
ent.Handle, d!=null?"DBTEXT":"MTEXT", st.Name, ent.Layer, txt.Replace("\n"," / ")));
}
Log("");
Log("DBText in the store: " + dbt + " MText: " + mt);
Result
Log
=== TEXT STYLES ===
Standard file=simplex.shx h=0.000 w=1.000
file=ltypeshp.shx h=0.000 w=1.000
Annotative file= h=0.000 w=1.000
SHR file=SIMPLEX h=0.750 w=1.000
S4 file=simplex h=0.056 w=1.000
L120 file=simplex.shx h=12.000 w=1.000
ROMAND file=romand.shx h=0.125 w=1.000
SIMPLEX file=romanc.shx h=3.200 w=1.000
CBL file=ROMANS h=0.023 w=1.000
DIM file=ic-dim.shx h=0.000 w=1.000
NEWSTYLE5 file=ic-dim.shx h=0.000 w=1.000
BLOCK$0$DIM file=ic-dim.shx h=0.000 w=1.000
L100 file=simplex h=5.000 w=1.000
ARIAL file=swissb.ttf h=0.000 w=1.000 TTF="Swis721 BT"
L30 file=simplex.shx h=3.000 w=0.850
L60 file=simplex.shx h=3.000 w=0.800
L20 file=simplex.shx h=2.000 w=1.000
anno-0.08 file=times.ttf h=0.080 w=1.000 TTF="Times New Roman"
LABELS file=times.ttf h=0.000 w=1.000 TTF="Times New Roman"
ARCH-1 file=arch-1.shx h=0.000 w=1.000
BP file=BKANT.TTF h=0.000 w=1.000 TTF="Book Antiqua"
L50 file=simplex h=1.000 w=1.000
CADdetails-DIMENSIONS file=ARIALN.TTF h=2.380 w=1.000 TTF="Arial Narrow"
file=GRCV.shx h=0.000 w=1.000
UTILITY file=romans.shx h=0.000 w=1.000
ARCHSING file=archsing h=0.000 w=1.000
ARCHCHIS file=archchis h=0.000 w=2.000
linetype file=simplex.shx h=0.000 w=1.000
OpenSans file=OpenSans-Regular.ttf h=0.000 w=1.000
OpenSansCondensed-Light file=OpenSansCondensed-Light.ttf h=0.000 w=1.000
Verdana file=verdana.ttf h=0.000 w=1.000 TTF="Verdana"
TITLE20 file=BKANT.TTF h=0.079 w=1.000 TTF="Book Antiqua"
GF_050 file=arial.ttf h=0.197 w=1.000 TTF="Arial"
HL-HD file=j:\LIBRARY\FONTS\bold.shx h=0.020 w=1.000
=== STORE TEXT: current style + type ===
[209A3] DBTEXT style=Standard layer=TEXT "Aisle"
[209A5] DBTEXT style=Standard layer=TEXT "Aisle"
[209C6] DBTEXT style=Standard layer=TEXT "locker"
[20F68] DBTEXT style=Standard layer=TEXT "Food"
[20F78] DBTEXT style=Standard layer=TEXT "Candy"
[20F90] DBTEXT style=Standard layer=TEXT "chips"
[20F98] DBTEXT style=Standard layer=TEXT "chips"
[20FA0] DBTEXT style=Standard layer=TEXT "candy"
[20FAE] DBTEXT style=Standard layer=TEXT "drinks"
[20FB6] DBTEXT style=Standard layer=TEXT "wine"
[20FBE] DBTEXT style=Standard layer=TEXT "snacks"
[20FC6] DBTEXT style=Standard layer=TEXT "Food"
[20FD4] DBTEXT style=Standard layer=TEXT "HSE products"
[20FE2] DBTEXT style=Standard layer=TEXT "chips"
[20FEA] DBTEXT style=Standard layer=TEXT "fruit"
[20FF2] DBTEXT style=Standard layer=TEXT "chips"
[20FFA] DBTEXT style=Standard layer=TEXT "frozen food"
[21017] DBTEXT style=Standard layer=TEXT "cabnits"
[2101F] DBTEXT style=Standard layer=TEXT "checkout counters"
[21027] DBTEXT style=Standard layer=TEXT "elec room"
[2102F] DBTEXT style=Standard layer=TEXT "gameroom"
[21037] DBTEXT style=Standard layer=TEXT "bathroom"
[2103F] DBTEXT style=Standard layer=TEXT "exit"
[21047] DBTEXT style=Standard layer=TEXT "entrance"
[21054] DBTEXT style=Standard layer=TEXT "t-shirts"
[21B9C] MTEXT style=Standard layer=TEXT "ice cream"
[21BBA] MTEXT style=Standard layer=TEXT "ice cream"
[21BC2] MTEXT style=Standard layer=TEXT "NON-ALCOHOIC DRINKS"
DBText in the store: 25 MText: 3Notes
What worked, what didn't, job-specific gotchas — flagged notes feed the recipes.
No notes yet.