VCOM:VectorWorks:ISDK::SetTextStyleRef

From Vectorworks Developer
Jump to navigation Jump to search

.SDK|SDK ..SDK:Types|SDK Types ..VCOM:VCOM (Vectorworks Component Object Model)|VCOM Basics ..VCOM:Class Reference|VCOM Class Reference

Description

namespace VectorWorks

Member of VCOM:VectorWorks:ISDK

Set the text style of a text-bearing object, including parametric objects that have the ovPluginHasFontStyle / ovCustomObjectFontStyle object variable set.

virtual void VCOM_CALLTYPE SetTextStyleRef(
MCObjectHandle object,
InternalIndex styleRef) = 0;
virtual void VCOM_CALLTYPE SetTextStyleRef(
MCObjectHandle object,
long firstChar,
long numChars,
InternalIndex styleRef) = 0;

Parameters

object MCObjectHandle The text-bearing object to change
styleRef InternalIndex The internal index of the text style to apply
firstChar long The index of the first character to change
numChars long The length of the run of characters to change

Remarks

Only the whole-object version is implemented as of Vectorworks 2011 SP2.

Example

InternalIndex styleIndex;
TXString myStyleName("MyStyleName");
if (gSDK->NameToInternalIndexN(myStyleName,styleIndex)) {
    gSDK->SetTextStyleRef(handleToMyObj,styleIndex);
}

Version

Availability: from Vectorworks 2011

See Also

VCOM:VectorWorks:ISDK::GetTextStyleRef

VCOM:VectorWorks:ISDK::NameToInternalIndexN

[[VCOM:VectorWorks:ISDK::GetTextStyleRef]] [[VCOM:VectorWorks:ISDK::NameToInternalIndexN]]