API reference

TASK MANAGER

solve_tasks

Solves the task manager

Parameters

This function receives no parameters

Returns

This function returns nothing

solve_task_manager()

Prints the current task flow to the standard output

Parameters

This function receives no parameters

Returns

This function returns nothing

print_task_flow()

purge_tasks

Removes all tasks from the Task Manager

Parameters

This function receives no parameters

Returns

This function returns nothing

INPUT / OUTPUT

warn

Prints a warning to the standard error, but continues processing the script

Parameters

Name

Parameter

Required

message

The message to warn

TRUE

Returns

This function returns nothing

inspect

Transforms a certain value into a detailed string. This works very simply for strings and numbers. Tables are transformed into JSON. However, Lua tables are more flexible than JSON objects... so take care of that.

Parameters

Name

Parameter

Required

value

The value to print

TRUE

Returns

This function returns nothing

EMP MODEL DATA

get_workplanes_list

Retrieves an array with the workplanes names in the model

Parameters

This function receives no parameters

Returns

Return

Description

workplanes

An array with the workplanes names

get_workplanes_data

Retrieves a table with the workplane information in the model. That is, name, maximum size of pixel (triangulation), tasks, etc.

Parameters

This function receives no parameters

Returns

Return

Description

workplanes

An array with the workplanes names

is_workplane

Checks if a workplane does exists in the model

Parameters

Name

Parameter

Required

workplane_name

The name of the workplane

TRUE

Returns

Return

Description

exist

True or False

count_workplane_polygons

Counts the number of polygons in a workplane

Parameters

Name

Parameter

Required

workplane_name

The name of the workplane

TRUE

Returns

Return

Description

n_polygons

The number of polygons

workplane

Creates a new Workplane

Parameters

Name

Parameter

Required

workplane_name

The name of the workplane

TRUE

Returns

This function returns nothing

get_metrics

Retrieves an array with the metrics

Parameters

This function receives no parameters

Returns

Return

Description

metrics

The metrics

get_metric

Retrieves a single metric

Parameters

Name

Parameter

Required

name

The name of the metric to retrieve

TRUE

Returns

Return

Description

a_metric

The metric

get_layers_list

Retrieves an array with the layer names in the model

Parameters

This function receives no parameters

Returns

Return

Description

layer_names

An array with the layer names

is_layer

Checks if a layer does exist in the model

Parameters

Name

Parameter

Required

layer_name

The name of the workplane

TRUE

Returns

Return

Description

exist

True or False

count_layer_objects

Counts the number of objects in a layer

Parameters

Name

Parameter

Required

layer_name

The name of the layer

TRUE

Returns

Return

Description

count

The number of objects

count_layer_instances

Counts the number of ComponentInstances in a layer

Parameters

Name

Parameter

Required

layer_name

The name of the layer

TRUE

Returns

Return

Description

count

The number of ComponentInstances

get_component_definitions_list

Retrieves an array with the ComponentDefinition names in the model

Parameters

This function receives no parameters

Returns

Return

Description

definitions

An array with the ComponentDefinition names

is_component_definition

Checks if a ComponentDefinition does exist in the model

Parameters

Name

Parameter

Required

name

The name of the ComponentDefinition

TRUE

Returns

Return

Description

exist

True or False

component

Adds a Component Definition to the model

Parameters

Name

Parameter

Required

name

The name of the ComponentDefinition

TRUE

Returns

Return

Description

a_component

The name of the component definition

count_component_definition_objects

Counts the number of objects in a ComponentDefinition

Parameters

Name

Parameter

Required

name

The name of the ComponentDefinition

TRUE

Returns

Return

Description

count

The number of objects

count_component_definition_instances

Counts the number of ComponentInstances in a ComponentDefinition

Parameters

Name

Parameter

Required

name

The name of the ComponentDefinition

TRUE

Returns

Return

Description

count

The number of ComponentInstances

get_location_data

Retrieves a table with the location of the model, containing: latitude, longitude, time_zone, city, country, albedo and elevation fields.

Parameters

This function receives no parameters

Returns

Return

Description

location

A table with the location data

get_materials_list

Retrieves a list of all the material names in the model

Parameters

This function receives no parameters

Returns

Return

Description

materials

A list with all the names of the materials

is_material

Checks if a material exists in the model

Parameters

Name

Parameter

Required

name

The name of the material

TRUE

Returns

Return

Description

is_material

A list with all the names of the materials

get_material_class

Gets the class of a certain material

Parameters

Name

Parameter

Required

name

The name of the material

TRUE

Returns

Return

Description

mat_class

A list with all the names of the materials

is_object

Checks if an object exists in the model

Parameters

Name

Parameter

Required

name

The name of the object

TRUE

Returns

Return

Description

is_object

Is it?

get_object_class

Gets the class of a certain object

Parameters

Name

Parameter

Required

name

The name of the material

TRUE

Returns

Return

Description

obj_class

A list with all the names of the materials

layer

Adds a new Layer object to the EmpModel

Parameters

Name

Parameter

Required

name

The name of the layer

TRUE

Returns

Return

Description

layer

The name of the created layer

bubble

Adds a new Bubble object to the EmpModel

Parameters

Name

Parameter

Required

data

The table with the data

TRUE

Returns

Return

Description

a_bubble

A table with the object information at time of creation

cone

Adds a new Cone object to the EmpModel

Parameters

Name

Parameter

Required

data

The table with the data

TRUE

Returns

Return

Description

a_cone

A table with the object information at time of creation

cup

Adds a new Cup object to the EmpModel

Parameters

Name

Parameter

Required

data

The table with the data

TRUE

Returns

Return

Description

a_cup

A table with the object information at time of creation

cylinder

Adds a new Cylinder object to the EmpModel

Parameters

Name

Parameter

Required

data

The table with the data

TRUE

Returns

Return

Description

a_cylinder

A table with the object information at time of creation

polygon

Adds a new Polygon object to the EmpModel

Parameters

Name

Parameter

Required

data

The table with the data

TRUE

Returns

Return

Description

a_polygon

A table with the object information at time of creation

ring

Adds a new Ring object to the EmpModel

Parameters

Name

Parameter

Required

data

The table with the data

TRUE

Returns

Return

Description

a_ring

A table with the object information at time of creation

source

Adds a new Source object to the EmpModel

Parameters

Name

Parameter

Required

data

The table with the data

TRUE

Returns

Return

Description

a_source

A table with the object information at time of creation

sphere

Adds a new Sphere object to the EmpModel

Parameters

Name

Parameter

Required

data

The table with the data

TRUE

Returns

Return

Description

a_sphere

A table with the object information at time of creation

tube

Adds a new Tube object to the EmpModel

Parameters

Name

Parameter

Required

data

The table with the data

TRUE

Returns

Return

Description

a_tube

A table with the object information at time of creation

dielectric

Adds a new Dielectric material to the EmpModel

Parameters

Name

Parameter

Required

data

The table with the data

TRUE

Returns

Return

Description

a_dielectric

The name of the material

glass

Adds a new Glass material to the EmpModel

Parameters

Name

Parameter

Required

data

The table with the data

TRUE

Returns

Return

Description

a_glass

The name of the material

glow

Adds a new Glow material to the EmpModel

Parameters

Name

Parameter

Required

data

The table with the data

TRUE

Returns

Return

Description

a_glow

The name of the material

interface

Adds a new Interface material to the EmpModel

Parameters

Name

Parameter

Required

data

The table with the data

TRUE

Returns

Return

Description

an_interface

The name of the material

light

Adds a new Light material to the EmpModel

Parameters

Name

Parameter

Required

data

The table with the data

TRUE

Returns

Return

Description

a_light

The name of the material

metal

Adds a new Metal material to the EmpModel

Parameters

Name

Parameter

Required

data

The table with the data

TRUE

Returns

Return

Description

a_metal

The name of the material

plastic

Adds a new Plastic material to the EmpModel

Parameters

Name

Parameter

Required

data

The table with the data

TRUE

Returns

Return

Description

a_plastic

The name of the material

spotlight

Adds a new Spotlight material to the EmpModel

Parameters

Name

Parameter

Required

data

The table with the data

TRUE

Returns

Return

Description

a_spotlight

The name of the material

trans

Adds a new Trans material to the EmpModel

Parameters

Name

Parameter

Required

data

The table with the data

TRUE

Returns

Return

Description

a_trans

The name of the material

view

Adds a new View to the EmpModel

Parameters

Name

Parameter

Required

data

The table with the data

TRUE

Returns

Return

Description

view

The name of the view

get_views_list

Returns a list of the views' names

Parameters

Name

Parameter

Required

data

The table with the data

TRUE

Returns

Return

Description

views

An array with the names of the views in the model

is_view

Returns a list of the views' names

Parameters

Name

Parameter

Required

data

The table with the data

TRUE

Returns

Return

Description

is_a_view

Does the view exist in the model?

box

Returns a list of the views' names

Parameters

Name

Parameter

Required

data

The table with the data

TRUE

Returns

This function returns nothing

instance

Creates a new ComponentInstancex

Parameters

Name

Parameter

Required

data

The table with the data

TRUE

Returns

This function returns nothing

SET-OPTIONS FUNCTIONS

ray_trace_options

Modifies the ray-tracing options in the current EmpModel

Parameters

Name

Parameter

Required

options

A Table with the ray-tracing options to set

TRUE

Returns

This function returns nothing

Prints the current ray-trace opcions. If a file is given, the options will be printed to such file. If not, the options will be printed to the Standard Output.

Parameters

Name

Parameter

Required

file

The name of the file to write

FALSE

Returns

This function returns nothing

EXPORT TO RADIANCE

write_scene_file

Adds a task to the task manager

Parameters

Name

Parameter

Required

task_name

The name of the task to add

TRUE

options

The options given

TRUE

Returns

This function returns nothing

write_model_info

Adds a task to the task manager

Parameters

Name

Parameter

Required

task_name

The name of the task to add

TRUE

options

The options given

TRUE

Returns

This function returns nothing

write_rif_file

Adds a task to the task manager

Parameters

Name

Parameter

Required

task_name

The name of the task to add

TRUE

options

The options given

TRUE

Returns

This function returns nothing

write_components

Adds a task to the task manager

Parameters

Name

Parameter

Required

task_name

The name of the task to add

TRUE

options

The options given

TRUE

Returns

This function returns nothing

write_views

Adds a task to the task manager

Parameters

Name

Parameter

Required

task_name

The name of the task to add

TRUE

options

The options given

TRUE

Returns

This function returns nothing

write_current_sky

Adds a task to the task manager

Parameters

Name

Parameter

Required

task_name

The name of the task to add

TRUE

options

The options given

TRUE

Returns

This function returns nothing

write_current_weather

Adds a task to the task manager

Parameters

Name

Parameter

Required

task_name

The name of the task to add

TRUE

options

The options given

TRUE

Returns

This function returns nothing

write_materials

Adds a task to the task manager

Parameters

Name

Parameter

Required

task_name

The name of the task to add

TRUE

options

The options given

TRUE

Returns

This function returns nothing

write_layers

Adds a task to the task manager

Parameters

Name

Parameter

Required

task_name

The name of the task to add

TRUE

options

The options given

TRUE

Returns

This function returns nothing

write_photosensors

Adds a task to the task manager

Parameters

Name

Parameter

Required

task_name

The name of the task to add

TRUE

options

The options given

TRUE

Returns

This function returns nothing

write_workplane

Adds a task to the task manager

Parameters

Name

Parameter

Required

task_name

The name of the task to add

TRUE

options

The options given

TRUE

Returns

This function returns nothing

RAY-TRACING

workplane_illuminance

Pushes a Calculate Workplane Illuminance task to the task manager

Parameters

Name

Parameter

Required

task_name

The name of the task to add

TRUE

options

The options given

TRUE

Returns

This function returns nothing

workplane_df

Pushes a Calculate Workplane Daylight Factor task to the task manager

Parameters

Name

Parameter

Required

task_name

The name of the task to add

TRUE

options

The options given

TRUE

Returns

This function returns nothing

workplane_udi

Pushes a Calculate Workplane Useful Daylight Illuminance task to the task manager

Parameters

Name

Parameter

Required

task_name

The name of the task to add

TRUE

options

The options given

TRUE

Returns

This function returns nothing

workplane_da

Pushes a Calculate Workplane Daylight Autonomy task to the task manager

Parameters

Name

Parameter

Required

task_name

The name of the task to add

TRUE

options

The options given

TRUE

Returns

This function returns nothing

workplane_ase

Pushes a Calculate Workplane Annual Sunlight Exposure task to the task manager

Parameters

Name

Parameter

Required

task_name

The name of the task to add

TRUE

options

The options given

TRUE

Returns

This function returns nothing

workplane_solar_irradiation

Pushes a Calculate Annual Solar Irradiation task to the task manager

Parameters

Name

Parameter

Required

task_name

The name of the task to add

TRUE

options

The options given

TRUE

Returns

This function returns nothing

workplane_daylight_exposure

Pushes a Calculate Annual Daylight Exposure task to the task manager

Parameters

Name

Parameter

Required

task_name

The name of the task to add

TRUE

options

The options given

TRUE

Returns

This function returns nothing

push_metric

Pushes a generic Workplane metric to the Task Manager. This is an alternative method to workplane_ase, workplane_da, etc.

Parameters

Name

Parameter

Required

task_name

The name of the task to add

TRUE

options

The options given

TRUE

Returns

This function returns nothing

OTHER

review

Calls RVU program

Parameters

This function receives no parameters

Returns

This function returns nothing

Last updated