This scenario describes how to build a dialog box that displays information coming from
your 3D model.
In this example, the dialog box includes a text block and a progress bar, and it uses as
input the length value of a curve.
Under the Component section of the
Interface category, select a UI Text
operator.
Define the content of the text block.
In this example, the text block includes a concatenation of two strings:
A text: Target Length:
A length value: 150mm
The concatenation is build with the Plus
operator.
Tip:
Connect a Watch node to the
output of the element to view its HTML result.
Insert a UI Progress Bar operator.
Define the Value input and the Max
input to represent in the component the progression between two values.
In this example:
The Value input is the length of a curve.
The Max input is the length value used as input in the
UI Text operation.
Organize the layout of your components.
Under the Container section, select an operator.
Connect your elements to the selected operator.
In this example, the UI Vertical Stack operator layouts the
components vertically.
Select the type of display for your element.
Under the Display section, select an operator.
Connect your container to the selected operator.
In this example, the UI Dialog operator displays the elements
in a dialog box.
Logic in the Editor Display in the 3D area
Optional:
Refine the display of your UI element using the UI Container
operator.
This operator lets you fine-tune the spacing of your elements by specifying
dimensions, adding margins, defining the alignment, etc.
Logic in the Editor Display in the 3D area
Connect your element to a Publish UI operator.
In the tree, your UI element appears under the Published UI node.
Important:
Publishing your UI elements is required to display the elements
in the 3D area when
the editor is closed.
Enrich the Design of a UI Element
Operators in the Container section let you refine the design
and the content of your UI elements.
This scenario shows how to enrich an element with tabs that contain expandable accordion
sections.
In the editor, insert a UI Tabs operator.
To specify the titles of the tabs, use a list of strings.
In this example, the logic uses the output of a List
Editor operator.
Insert a UI Accordion operator.
To specify the titles of the sections, use a list of strings.
In this example, the logic uses the output of a List
Editor operator.
Define the content of the expandable sections.
In this example, a list of target lengths is built using the
Plus operator.
Connect the output of the UI Accordion operation to the
Contents input of the UI Tabs
operation.
Connect the output of the UI Tabs operation to a UI
container.
In our example, the UI Tabs operation is connected to a
UI Panel operator.Logic in the Editor Display in the 3D area
Pilot 3D Content with UI Elements
Operators in the Interactive section let you add editable
and clickable fields in your UI elements. Interactive elements can drive other UI elements
or the geometry.
This scenario shows how to pilot the radius of a circle with a length value specified in a
customized dialog box.
Before you begin: Create a geometry. For example, a circle with a 50-mm
radius.
Under the Interactive section of the
Interface category, select a UI Input
Number operator.
This operator lets you create an editable field that is used to define a
parameter.
Other operators
for inputs are available: UI Input Text, UI Input
Boolean, and UI Input Choice Picker.
Specify the inputs of the operator.
In our example, the following inputs are specified.
Input
Description
Label
Name of the field in the UI element.
In our example: Circle
Radius
Type
Type of the parameter.
In our example:
Length
Display
Display style of the field.
In our example:
Minus-Plus
Default Value
Default value of the parameter.
In our example:
100mm
Step
Incremental value.
In our example: 50
Connect the UI Element output of the UI Input
Number operation to a container.
In our example, the operation is connected to a UI
Dialog operator.Logic in the Editor Display in the 3D area
Connect the Value output of the UI Input
Number operation to the input parameter that you want to pilot.
In our example, the Value output is connected to the
Radius input of the circle.
The connection updates the
Radius input from 50mm to 100mm.
In your UI element, edit the value in the interactive field.
The piloted geometry updates instantly.
Trigger the Display of a UI Element
By default, a UI element appears in the 3D area whenever
the input of a UI operator is modified. You can create buttons to trigger the display of a
UI element on demand.
Trigger buttons can appear in the Experiment panel or on a
geometry.
Display a UI element using a button in the Experiment
panel.
Under the Trigger section of the
Interface category, select a Trigger Button
Controller operator.
Specify a label to define the name of your button.
For example:
Connect the Trigger Button Controller operation to the
Trigger input of a UI element.
For example:
In the toolbar, click Controller.
In the Experiment panel, the operation appears as a
new controller.
Click the button to display the UI element in the 3D area.
Display a UI element using a button in the 3D area.
Under the Trigger section of the
Interface category, select a Trigger 3D
Button operator.
Connect the Geometry input to the output geometry where
you want the button to appear.
For example:
In
the 3D area,
the button appears on the geometry.
Connect the Trigger 3D Button operation to the
Trigger input of a UI element.
For example:
Click the button to display the UI element in the 3D area.
Important:
Publishing your UI elements is required to display the
elements in the 3D area
when the editor is closed.