Hello World Example

Description

This demonstrates a simple Hello World example of displaying a text label in the UI layout.

Python Script Files

  • hello_world_ui.py

Significant Script Features

# Set pre-defined properties of ToolPropertyContainer
def getUIContent():

   my_toolProperty = apex_sdk.ToolPropertyContainer()

   # Define UI
   my_toolProperty.ToolPropertyContent = getCustomToolPropertyContent()
   
   return my_toolProperty

# Define Layout and Components
def getCustomToolPropertyContent():

   # Create Text Block
   meshTextBlock = WPFControls.TextBlock()
   meshTextBlock.Text = "Hello world!"

   return meshTextBlock

Notes

  • The ToolPropertyContent is set and defined by the getCustomToolPropertyContent() function
  • The getCustomToolPropertyContent() function creates the WPF TextBlock component with its text content set to a "Hello world!" string
  • There is no grid and typical layout component used, the TextBlock is the sole UI component in this example