C3D-0358 · READ-ONLY: text-orientation dim vars on 168.1' and 122.0' (handles 21C7B, 21C55) [C3D-DIMREAD] done
Reads Dimtih/Dimtoh/Dimtmove/Dimjust, TextRotation and TextPosition, and the extension/dim-line points on the two target dimensions, plus their dim style's defaults, so the text-along-the-line change is made with the right override flags rather than guessed.
C# payload
// READ-ONLY. The text-orientation dim vars on the two target dimensions, plus every
// AlignedDimension's DimText handle map so we target exactly the right objects.
var handles = new string[] { "21C7B", "21C55" }; // 168.1' and 122.0'
Log("drawing: " + Db.Filename);
var ms = (BlockTableRecord)Tx.GetObject(SymbolUtilityServices.GetBlockModelSpaceId(Db), OpenMode.ForRead);
foreach (ObjectId id in ms) {
var dim = Tx.GetObject(id, OpenMode.ForRead) as Dimension;
if (dim == null) continue;
string h = dim.Handle.ToString();
bool target = false;
foreach (var t in handles) if (string.Equals(h, t, StringComparison.OrdinalIgnoreCase)) target = true;
if (!target) continue;
Log("");
Log(string.Format("[{0}] {1} text=\"{2}\" meas={3:F3}", h, dim.GetType().Name, dim.DimensionText, dim.Measurement));
Log(string.Format(" Dimtih (text-inside horizontal) = {0}", dim.Dimtih));
Log(string.Format(" Dimtoh (text-outside horizontal) = {0}", dim.Dimtoh));
Log(string.Format(" Dimtmove = {0} Dimjust = {1}", dim.Dimtmove, dim.Dimjust));
Log(string.Format(" TextRotation = {0:F4} TextPosition = ({1:F3},{2:F3})",
dim.TextRotation, dim.TextPosition.X, dim.TextPosition.Y));
var ad = dim as AlignedDimension;
if (ad != null)
Log(string.Format(" XLine1 ({0:F3},{1:F3}) XLine2 ({2:F3},{3:F3}) DimLine ({4:F3},{5:F3})",
ad.XLine1Point.X, ad.XLine1Point.Y, ad.XLine2Point.X, ad.XLine2Point.Y, ad.DimLinePoint.X, ad.DimLinePoint.Y));
var st = (DimStyleTableRecord)Tx.GetObject(dim.DimensionStyle, OpenMode.ForRead);
Log(string.Format(" style \"{0}\": Dimtih={1} Dimtoh={2} Dimtmove={3}", st.Name, st.Dimtih, st.Dimtoh, st.Dimtmove));
}
Result
Log
drawing: C:\Users\sanja\OneDrive\_SurveyDisco\260714 - 285 Huckaby Rd, Brooks, GA 30205, USA\260714 - 285 Huckaby Rd R4.dwg [21C55] AlignedDimension text="122.0'" meas=122.025 Dimtih (text-inside horizontal) = True Dimtoh (text-outside horizontal) = True Dimtmove = 0 Dimjust = 0 TextRotation = 0.0000 TextPosition = (2206226.843,1207015.378) XLine1 (2206226.902,1207076.390) XLine2 (2206226.784,1206954.366) DimLine (2206226.784,1206954.366) style "Standard": Dimtih=True Dimtoh=True Dimtmove=0 [21C7B] AlignedDimension text="168.1'" meas=168.106 Dimtih (text-inside horizontal) = True Dimtoh (text-outside horizontal) = True Dimtmove = 0 Dimjust = 0 TextRotation = 0.0000 TextPosition = (2206224.141,1207267.345) XLine1 (2206224.141,1207143.510) XLine2 (2206224.141,1207311.616) DimLine (2206224.141,1207311.616) style "Standard": Dimtih=True Dimtoh=True Dimtmove=0
Notes
What worked, what didn't, job-specific gotchas — flagged notes feed the recipes.
No notes yet.