Overview

The Medeek Truss API allows developers and advanced users to programmatically create and manipulate Medeek roof truss assemblies inside SketchUp using Ruby.

Currently the documented attribute library access methods on this page are only avaialable for the Common Truss family.

All public API methods are accessed through the following modules and classes:

Medeek_Engineering_Inc_Extensions::
  MedeekTrussPlugin::
  MedeekMethods


common_truss_draw

Creates a new common truss assembly from a selected horizontal face, a SketchUp face object, or an array of four corner points that define a rectangular footprint.

Syntax

common_truss_draw(pitch = 4.0, trusstype = 'Fink', pts = nil)

Parameters

  • pitch - Roof pitch expressed as rise in inches per 12 inches of run. Must be numeric and between 0.25 and 24.0.
  • trusstype - The common truss web configuration/type. Valid truss types are given below (case sensitive).
  • pts - Optional input geometry. May be omitted to use the current selected face, a Sketchup::Face object, an array of Geom::Point3d objects, or an array of [x,y,z] point arrays.

Valid Truss Types

  • King Post
  • Queen Post
  • Fink
  • Howe
  • Fan
  • Mod Queen
  • Double Fink
  • Double Howe
  • Mod Fan
  • Triple Fink
  • Triple Howe
  • Quad Fink
  • Quad Howe
  • Penta Howe

Examples:

mod = Medeek_Engineering_Inc_Extensions::
      MedeekTrussPlugin::
      MedeekMethods

mod.common_truss_draw
mod = Medeek_Engineering_Inc_Extensions::
      MedeekTrussPlugin::
      MedeekMethods

mod.common_truss_draw(6.0, 'Howe')
mod = Medeek_Engineering_Inc_Extensions::
      MedeekTrussPlugin::
      MedeekMethods

face = Sketchup.active_model.selection.grep(Sketchup::Face)[0]
mod.common_truss_draw(4.0, 'Fink', face)
mod = Medeek_Engineering_Inc_Extensions::
      MedeekTrussPlugin::
      MedeekMethods

pts = [[48,48,0], [240,48,0], [240,288,0], [48,288,0]]
mod.common_truss_draw(4.0, 'Fink', pts)

Notes

  • The input face or point set must define a horizontal rectangle in sequential order.
  • If an array of points is supplied, exactly four points are required.
  • All supplied points will be normalized to a common elevation before the truss is created.

validate_medeektruss

Validates that the provided group represents a Medeek Truss assembly.

Syntax

validate_medeektruss(group)

Parameters

  • group - Truss group name or SketchUp group object

Returns

  • true, group - valid Medeek truss group
  • false, group - invalid object

Example

Medeek_Engineering_Inc_Extensions::MedeekTrussPlugin::MedeekMethods.validate_medeektruss('TRUSS_ASSEMBLY_20260323172442')

truss_regen

Regenerates an existing truss assembly.

Syntax

truss_regen(group = nil)

Parameters

  • group - Truss group name or SketchUp group object (optional)

Example

Medeek_Engineering_Inc_Extensions::MedeekTrussPlugin::MedeekMethods.truss_regen
Medeek_Engineering_Inc_Extensions::MedeekTrussPlugin::MedeekMethods.truss_regen('TRUSS_ASSEMBLY_20260323172442')

Notes

  • If no group name is supplied the current selection set in the model will be analyzed.
  • At this time regeneration is only enabled for Common and Monopitch trusses.

common_truss_read_attributes

Reads the stored attributes from an existing Medeek Truss assembly. Since the attributes are stored in nested libraries the data is given as a hash of hashes.

Syntax

common_truss_read_attributes(group = nil)

Parameters

  • group - Truss group name or SketchUp group object (optional)

Returns

  • A hash of truss attributes when the assembly is valid
  • false or nil if the supplied object is not a valid Medeek Truss assembly

Example

Medeek_Engineering_Inc_Extensions::MedeekTrussPlugin::MedeekMethods.common_truss_read_attributes('TRUSS_ASSEMBLY_20260323172442')

Notes

  • Use this method when you need to inspect all available truss settings/parameters.
  • Please read the attribute library index to understand what each parameter/attribute does with regards to the truss assembly.
  • This method is only intended for reading truss configuration data; it does not alter the model or the truss assembly.
  • If no truss group name is supplied the selection set in the model will be analyzed to determine if a truss assembly has been selected.

common_truss_get_attribute

Reads a single stored attribute from an existing Medeek Truss assembly.

Syntax

common_truss_get_attribute(param, group = nil)

Parameters

  • param - The name of the attribute/parameter to read
  • group - Truss group name or SketchUp group object (optional)

Returns

  • The current value of the requested attribute/parameter
  • false or nil if the supplied object is not a valid Medeek Truss assembly
  • nil if the requested attribute does not exist or has no stored value

Examples

Medeek_Engineering_Inc_Extensions::MedeekTrussPlugin::MedeekMethods.common_truss_get_attribute('PITCH')
Medeek_Engineering_Inc_Extensions::MedeekTrussPlugin::MedeekMethods.common_truss_get_attribute('PITCH', 'TRUSS_ASSEMBLY_20260323172442')

Notes

  • This method is useful when querying one specific parameter without reading the entire truss attribute library.
  • This method is only intended for reading truss configuration data; it does not alter the model or the truss assembly.
  • If no truss group name is supplied the selection set in the model will be analyzed to determine if a truss assembly has been selected.
  • Please read the attribute library index to understand what each parameter/attribute does with regards to the truss assembly.

common_truss_set_attribute

Sets a single stored attribute within an existing Medeek Truss assembly.

Syntax

common_truss_set_attribute(param, value, group = nil, regen = false)

Parameters

  • param - The name of the attribute/parameter to set
  • value - The new value to assign to the specified attribute/parameter
  • group - Truss group name or SketchUp group object (optional)
  • regen flag - Set to true or false in order to regen the assembly after the new value is set, default is false (optional)

Returns

  • true if the attribute was successfully updated
  • false or nil if the supplied object is not a valid Medeek Truss assembly
  • false if the requested attribute cannot be updated

Examples

Medeek_Engineering_Inc_Extensions::MedeekTrussPlugin::MedeekMethods.common_truss_set_attribute('PITCH', 6.0)
Medeek_Engineering_Inc_Extensions::MedeekTrussPlugin::MedeekMethods.common_truss_set_attribute('PITCH', 6.0, true)
Medeek_Engineering_Inc_Extensions::MedeekTrussPlugin::MedeekMethods.common_truss_set_attribute('PITCH', 6.0, 'TRUSS_ASSEMBLY_20260323172442')
Medeek_Engineering_Inc_Extensions::MedeekTrussPlugin::MedeekMethods.common_truss_set_attribute('PITCH', 6.0, 'TRUSS_ASSEMBLY_20260323172442', true)

Notes

  • Use this method when you need to modify a single truss setting/parameter.
  • Please read the attribute library index to understand what each parameter/attribute does with regards to the truss assembly.
  • This method only updates the specified truss attribute/parameter; it does not automatically redraw or regenerate the truss assembly unless the regen flag is set to true.
  • If no truss group name is supplied the selection set in the model will be analyzed to determine if a truss assembly has been selected.