SizeToString Method (IFormatProvider, String)

Returns a string that represents this instance (in fractional inches if advanced option XS_USE_ONLY_INCHES_IN_SHEET_SIZES set to true).

Namespace:  Tekla.Structures.Drawing
Assembly:  Tekla.Structures.Drawing (in Tekla.Structures.Drawing.dll) Version: 2023.0.3
Syntax
public string ToString(
	IFormatProvider formatProvider,
	string separator = null
)

Parameters

formatProvider
Type: SystemIFormatProvider
The format provider.
separator (Optional)
Type: SystemString
The optional separator characters(s) - defaults to "x".

Return Value

Type: String
A string that represents this instance.
Examples
This example shows how to convert a Size instance into a string representation using a format provider and optionally a specific separator parameter. The result is affected by the value of the advanced option: XS_USE_ONLY_INCHES_IN_SHEET_SIZES. In order for this advanced option to work, set the advanced options XS_IMPERIAL and XS_IMPERIAL_INPUT to TRUE. If the advanced option XS_USE_ONLY_INCHES_IN_SHEET_SIZES is set to TRUE the result would display as: 17" * 10"1/2 but if set to FALSE it would display as: 431,8 * 266,7 If not specified, the separator defaults to: x (lower case).
using Tekla.Structures.Drawing;

public class Example
{
       public void Example1()
       {
           // For this demonstration, we'll format 431.8x266.7 millimeters.
           Size size = new Size(431.8, 266.7);

           var germanCulture = System.Globalization.CultureInfo.CreateSpecificCulture("de-DE");
           string formattedString = size.ToString(germanCulture, " * ");
       }
}
See Also
Was this helpful?
The feedback you give here is not visible to other users. We use your comments to improve the content.
Previous
Next