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

purge_tasks()

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

warn(message)

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

     r = inspect("car")
     print( r )
     --[[
     this should print:

     "car"
     ]]

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

workplanes  = get_workplanes_list()

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

workplanes  = get_workplanes_data()

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

exist  = is_workplane(workplane_name)

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

n_polygons  = count_workplane_polygons(workplane_name)

workplane

Creates a new Workplane

Parameters

Name

Parameter

Required

workplane_name

The name of the workplane

TRUE

Returns

This function returns nothing

workplane(workplane_name)

get_metrics

Retrieves an array with the metrics

Parameters

This function receives no parameters

Returns

Return

Description

metrics

The metrics

metrics  = get_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

a_metric  = get_metric(name)

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

layer_names  = get_layers_list()

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

exist  = is_layer(layer_name)

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  = count_layer_objects(layer_name)

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

count  = count_layer_instances(layer_name)

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

definitions  = get_component_definitions_list()

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

exist  = is_component_definition(name)

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

a_component  = component(name)

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  = count_component_definition_objects(name)

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

count  = count_component_definition_instances(name)

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

location  = get_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

materials  = get_materials_list()

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

is_material  = is_material(name)

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

mat_class  = get_material_class(name)

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?

is_object  = is_object(name)

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

obj_class  = get_object_class(name)

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

layer  = layer(name)

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

a_bubble  = bubble(data)

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

a_cone  = cone(data)

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

a_cup  = cup(data)

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

a_cylinder  = cylinder(data)

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

a_polygon  = polygon(data)

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

a_ring  = ring(data)

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

a_source  = source(data)

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

a_sphere  = sphere(data)

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

a_tube  = tube(data)

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

a_dielectric  = dielectric(data)

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

a_glass  = glass(data)

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

a_glow  = glow(data)

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

an_interface  = interface(data)

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

a_light  = light(data)

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

a_metal  = metal(data)

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

a_plastic  = plastic(data)

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

a_spotlight  = spotlight(data)

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

a_trans  = trans(data)

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

view  = view(data)

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

views  = get_views_list(data)

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?

is_a_view  = is_view(data)

box

Returns a list of the views' names

Parameters

Name

Parameter

Required

data

The table with the data

TRUE

Returns

This function returns nothing

box(data)

instance

Creates a new ComponentInstancex

Parameters

Name

Parameter

Required

data

The table with the data

TRUE

Returns

This function returns nothing

instance(data)

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

ray_trace_options(options)

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

print_ray_trace_options(file)

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_scene_file(task_name, options)

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_model_info(task_name, options)

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_rif_file(task_name, options)

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_components(task_name, options)

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_views(task_name, options)

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_sky(task_name, options)

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_current_weather(task_name, options)

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_materials(task_name, options)

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_layers(task_name, options)

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_photosensors(task_name, options)

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

write_workplane(task_name, options)

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_illuminance(task_name, options)

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_df(task_name, options)

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_udi(task_name, options)

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_da(task_name, options)

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_ase(task_name, options)

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_solar_irradiation(task_name, options)

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

workplane_daylight_exposure(task_name, options)

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

push_metric(task_name, options)

OTHER

review

Calls RVU program

Parameters

This function receives no parameters

Returns

This function returns nothing

review()

Last updated