Skip to content

Resource control

Resource controls are giving the user access to the internal resources of Allplan such as pen, stroke or layer.

Pen

This type of parameter is used to create a combo box for a pen selection. The result assigned to the parameter is the integer associated with the selected pen.

Pen control

<Parameter>
    <Name>Pen</Name>
    <Text>Pen</Text>
    <Value>-1</Value><!--(1)!-->
    <ValueType>Pen</ValueType>
</Parameter>
  1. If the <Value> is set to -1, the parameter is initialized with current Allplan setting.

Stroke

This type of parameter is used to create a combo box for a stroke selection. The result assigned to the parameter is the integer associated with the selected stroke.

Stroke control

<Parameter>
    <Name>Stroke</Name>
    <Text>Stroke</Text>
    <Value>-1</Value><!--(1)!-->
    <ValueType>Stroke</ValueType>
</Parameter>
  1. If the <Value> is set to -1, the parameter is initialized with current Allplan setting.

Color

This type of parameter is used to create a combo box for a color selection. Unlike the parameter with RGB Color Dialog, the user can only select one of the standard Allplan colors, not any desired RGB color. The result assigned to the parameter is the integer associated with the selected stroke.

Color control

<Parameter>
    <Name>Color</Name>
    <Text>Color</Text>
    <Value>-1</Value><!--(1)!-->
    <ValueType>Color</ValueType>
</Parameter>
  1. If the <Value> is set to -1, the parameter is initialized with current Allplan setting.

Layer

This type of parameter is used to create a combo box for a layer selection. The result assigned to the parameter is the integer associated with the selected layer.

Layer control

<Parameter>
    <Name>Layer</Name>
    <Text>Layer</Text>
    <Value>-1</Value><!--(1)!-->
    <ValueType>Layer</ValueType>
</Parameter>
  1. If the <Value> is set to -1, the parameter is initialized with current Allplan setting.

Hatch

This type of parameter is used to create a combo box for a hatching selection. The result assigned to the parameter is the integer associated with the selected hatch.

Hatch control

<Parameter>
    <Name>Hatch</Name>
    <Text>Hatching</Text>
    <Value>-1</Value><!--(1)!-->
    <ValueType>Hatch</ValueType>
</Parameter>
  1. If the <Value> is set to -1, the parameter is initialized with current Allplan setting.

Pattern

This type of parameter is used to create a combo box for a pattern selection. The result assigned to the parameter is the integer associated with the selected pattern.

Pattern control

<Parameter>
    <Name>Pattern</Name>
    <Text>Pattern</Text>
    <Value>-1</Value><!--(1)!-->
    <ValueType>Pattern</ValueType>
</Parameter>
  1. If the <Value> is set to -1, the parameter is initialized with current Allplan setting.

Face style

This type of parameter is used to create a combo box for a face style selection. The result assigned to the parameter is the integer associated with the selected face style.

Face style control

<Parameter>
    <Name>FaceStyle</Name>
    <Text>FaceStyle</Text>
    <Value>-1</Value><!--(1)!-->
    <ValueType>FaceStyle</ValueType>
</Parameter>
  1. If the <Value> is set to -1, the parameter is initialized with current Allplan setting

Font

Font style

This type of parameter is used to create a combo box for a font style selection. The result assigned to the parameter is the integer associated with the selected font style.

Font style control

<Parameter>
    <Name>FontId</Name>
    <Text>Font ID</Text>
    <Value>21</Value><!--(1)!-->
    <ValueType>Font</ValueType>
</Parameter>
  1. You cannot assign the current Allplan setting here with -1 value!

Font emphasis

This type of parameter is used to create four buttons to control the font empasis: bold, italic, underline and crossed out.

Font emphasis control

<Parameter>
    <Name>FontEmphasis</Name>
    <Text>Emphasis</Text>
    <Value>0</Value>
    <ValueType>FontEmphasis</ValueType>
</Parameter>

The result of this parameter is a 4-bit integer, where:

  • the first bit from right indicates the bold state
  • the second bit from right indicates the italic state
  • the third bit from right indicates the underlined state
  • the fourth bit from right indicates the crossed out state

Tip

For some font styles, called Allplan fonts, it is not possible to set bold or crossed out state to True. To deactivate the emphasis options based on the font selected by the user, use the <Constraint> tag and specify the name of the font parameter there

Font emphasis constraint

<Parameter>
    <Name>FontEmphasis</Name>
    <Text>Emphasis</Text>
    <Value>0</Value>
    <ValueType>FontEmphasis</ValueType>
    <Constraint>FontId</Constraint>
</Parameter>

For the Allplan fonts it is possible to control their slope angle, when the italic state is turned on. For that reason you have to insert an angle control into the palette. If you do that, the control must be disabled, when an non-Allplan font is selected or the italic is turned off. To achieve this behavior, you can set the <Constraint> tag as follows

Font angle constraint

<Parameter>
    <Name>FontAngle</Name>
    <Text>Angle for italic text</Text>
    <Value>90</Value>
    <ValueType>Angle</ValueType>
    <Constraint>FontId;FontEmphasis</Constraint> <!--(1)!-->
</Parameter>
  1. Provide the name of the font style parameter first and the font emphasis parameter last, separated with ;. When the user selects an Allplan font in the first parameter, and set the italic in the second one, the angle control will be enabled.

Example on GitHub

All above mentioned functionalities of the font controls are shown in the example Font ( PYP | PY).