I've created a piece of text using a TextBlock. I specified a "template" when I called TextHandlerBase::CreateElement(). Once the text was added to the model, I inspected it using the "properties" dialog and I see this:
What does this mean? Did I do something wrong in the text creation process?
extern "C" bool CreateText(EditElementHandleR eehTextElem, ElementHandleCP pTemplate, WCharCP theText, DPoint3dR origin, DPoint3dR tangent) { DgnTextStylePtr tStyle = DgnTextStyle::GetByName(L"SRS Mask 1", *ISessionMgr::GetActiveDgnFile()); double heightUOR = 0.0; mdlCnv_masterToUOR(&heightUOR, 1. / 8. / 12., ACTIVEMODEL); tStyle->SetProperty(TextStyleProperty::TextStyle_Height, heightUOR); tStyle->SetProperty(TextStyleProperty::TextStyle_Width, heightUOR * 0.75); // TextBlockProperties-Represents the properties that can be controlled on a per-TextBlock basis. TextBlockPropertiesPtr tbProps = TextBlockProperties::Create(*ISessionMgr::GetActiveDgnModelP()); // ParagraphProperties-Represents the properties that can be controlled on a per-Paragraph basis. DgnModelP model = ISessionMgr::GetActiveDgnModelP(); ParagraphPropertiesPtr paraProps = ParagraphProperties::Create(*tStyle, *model); paraProps->SetJustification(TextElementJustification::CenterMiddle); // RunProperties-Describes the formatting and spacing paramters for a single run of text that TextBlock supports. RunPropertiesPtr runProps = RunProperties::Create(*tStyle,*model); TextBlockPtr textBlock = TextBlock::Create(*tbProps,*paraProps,*runProps,*model); textBlock->AppendText(L"P"); textBlock->SetUserOrigin(origin); CaretPtr caretFrom = textBlock->CreateStartCaret(); CaretPtr caretTo = textBlock->CreateEndCaret(); textBlock->ApplyTextStyle(*tStyle.get(), true, *caretFrom.GetCR(), *caretTo.GetCR()); RotMatrix rMatrix = { 0 }; mdlRMatrix_fromAngle(&rMatrix, mdlVec_angleXY(&tangent)); textBlock->SetOrientation(rMatrix); textBlock->PerformLayout(); if (TEXTBLOCK_TO_ELEMENT_RESULT_Success == (TextHandlerBase::CreateElement(eehTextElem, pTemplate /*nullptr*/, *textBlock))) { } return eehTextElem.IsValid(); }
Thanks,
Bruce
"Varies Across" means at least 2 runs of text exist within the text element for which the value of the property differs.
For example, if you've got a text element containing the string "Red Green" where "Red" is red and "Green" is green, the Color property will be "Varies Across".