ex02_circle

Scripted circle element example

This is an example for a scripted ‘circle’ element.

Note

Please see offset_point_v2.md for a complete scripted elements example with detailed description.

Source code excerpt

 1def dialog(context, params):
 2    #[...]
 3
 4def calculation(context, params):
 5    valid_results = False
 6
 7    # Calculating all available stages
 8    for stage in context.stages:
 9        # Access element properties with error handling
10        try:
11            context.result[stage] = {
12                'center': (params['center_x'], params['center_y'], params['center_z']),
13                'direction': (params['dir_x'], params['dir_y'], params['dir_z']),
14                'radius': params['radius']
15            }
16            context.data[stage] = {"ude_mykey": "Example 2"}
17        except Exception as error:
18            context.error[stage] = str(error)
19        else:
20            valid_results = True
21    return valid_results