How to separate characters from a decimal string to create labels

Objective:

Learn how to separate characters from a three decimal (00.0) string to create labels from properties by using a Custom Block. This Custom Block is designed by Raymond Weitekamp from Polyspectra.

Applies to:

  • Serialization
  • Implicit modeling

Prerequisites:

This Custom Block may have other uses, but for this tutorial, we are using it with the Serialization Custom Block. Follow along with this nTop Live to learn how to use the Serialization Custom Block.

This article uses a Custom Block to create our desired outcome. If you are new to using Custom Blocks, learn how to import, modify, and update them with the following resources:

Procedure:

Start with all required Custom Blocks imported.

1. Generate the property you want to turn into a label.

    • Ex. Create a Box from Corners and extract the X-value from the Max Point.

2. This Custom Block doesn't account for units and it doesn't work for negative values. 

    • Divide the Max Point property by 1 mm.
    • Multiply by -1 if you need to remove a negative value.

3. Add the value to the Custom Block, CB - 3 Decimal String (created by Raymond Weitekamp from Polyspectra). 

4. Add the Serialize Custom Block

    • Insert the CB - 3 Decimal String block in the ItemName input.
    • Set an Index value.
    • Define the Text Size, Letter Spacing, and String Position.
    • Edit the Directory to look at your own local folder. Make sure to have a '\' at the end of the string. 

serialize.png

And that’s it! You’ve successfully separated the values into separate characters and created a label

Are you still having issues? Contact the support team, and we’ll be happy to help!

Download the Example file:

More on this topic:

Keywords:

 add scalar value how-to text number 3 serial serialize decimal characters character integer 
Was this article helpful?