Text Customization

CadSDK provides extensive control over text appearance and formatting through various properties available in Text and MultilineText elements.

Text Properties and Alignment

// Single-line text with custom properties
var text = new Text
{
    InsertionPoint = new Vector3(0, 0, 0),
    TextString = "Sample Text",
    Height = 2.5f,                           // Text height
    WidthFactor = 0.8f,                     // Text width scaling
    Rotation = MathF.PI / 4,                // 45-degree rotation
    Alignment = TextAlignment.MiddleCenter,  // Center alignment
    StyleName = "STANDARD"                   // Text style
};

// Multiline text with custom formatting
var mtext = new MultilineText
{
    InsertionPoint = new Vector3(10, 0, 0),
    TextString = "First Line\nSecond Line",
    Height = 2.5f,
    RectWidth = 50f,                       // Text box width
    LineSpacingFactor = 1.5f,              // Line spacing
    Alignment = TextAlignment.TopLeft,      // Top-left alignment
    Wrap = true                            // Enable text wrapping
};
# Coming soon...