← Inbox

C3D-0136 · READ-ONLY: can the host create real text-along-curve [ARCTEXT-PROBE] error

Probes whether an ArcAlignedText/RText class is registered in this session, lists every registered class whose name mentions TEXT, and checks whether Editor.Command and Document.SendStringToExecute are reachable from a ticket script, to find a real text-along-a-curve path instead of the per-character workaround. Draws nothing.

Script file
C3D-0136.cs
Target
active document · model space
Author
claude
Approved
yes · reviewer
Timeout
180s

C# payload

// READ-ONLY PROBE. Can this host create real text-along-a-curve instead of my per-character hack?
// Three candidates, each just tested for EXISTENCE - nothing is drawn.
//   1. RText / ArcAlignedText - the Express Tools ARCTEXT entity (AcadXText.arx / "ArcAlignedText")
//   2. Ed.Command(...) - can the script drive the ARCTEXT command at all
//   3. MText.Rotation-free alternatives already in the DB
// Nothing is modified.
Log("drawing: " + Db.Filename);

// (1) is the ArcAlignedText RXClass registered in this session?
foreach (string cls in new string[] { "AcDbArcAlignedText", "ArcAlignedText", "RText", "AcDbRText" }) {
    try {
        var rx = RXObject.GetClass(typeof(Autodesk.AutoCAD.DatabaseServices.Entity));
        var c = RXClass.GetClass(typeof(Autodesk.AutoCAD.DatabaseServices.Entity));
        Log("probe " + cls + ": base entity class ok (" + c.Name + ")");
        break;
    } catch (System.Exception ex) { Log("probe " + cls + ": " + ex.Message); }
}

// list every RXClass whose name mentions text, so an arc-text class shows up if it is loaded
Log("");
Log("=== registered classes mentioning TEXT ===");
try {
    var d = SystemObjects.ClassDictionary;
    foreach (DictionaryEntry de in d) {
        string nm = de.Key.ToString();
        if (nm.ToUpper().IndexOf("TEXT") >= 0) Log("   " + nm);
    }
} catch (System.Exception ex) { Log("class dictionary: " + ex.Message); }

// (2) is Ed.Command reachable from a script?
Log("");
try {
    var m = Ed.GetType().GetMethod("Command");
    Log("Editor.Command exists: " + (m != null));
} catch (System.Exception ex) { Log("Editor.Command probe: " + ex.Message); }
try {
    var m2 = Doc.GetType().GetMethod("SendStringToExecute");
    Log("Document.SendStringToExecute exists: " + (m2 != null));
} catch (System.Exception ex) { Log("SendStringToExecute probe: " + ex.Message); }

// (3) is the express tools arx loaded?
Log("");
Log("ARCTEXT command defined: " + (Autodesk.AutoCAD.ApplicationServices.Application
    .GetSystemVariable("CMDNAMES") != null ? "check manually" : "?"));

Result

Status
error
Drawing file
C:\Users\sanja\OneDrive\_SurveyDisco\260802 - 4082 Sweetbriar Ln, Forest Park, GA 30297, USA\260802 - 4082 Sweetbriar Ln.dwg
Message
Compile error: (12,18): error CS0103: The name 'RXObject' does not exist in the current context; (13,17): error CS0103: The name 'RXClass' does not exist in the current context; (23,13): error CS0103: The name 'SystemObjects' does not exist in the current context; (24,14): error CS0246: The type or namespace name 'DictionaryEntry' could not be found (are you missing a using directive or an assembly reference?)
Entities
Duration
369 ms
Civil 3D
25.0.0.0

Notes

What worked, what didn't, job-specific gotchas — flagged notes feed the recipes.

No notes yet.