Overview

The Medeek Floor API allows developers and advanced users to programmatically create and manipulate Medeek Floor assemblies inside SketchUp using Ruby. The current public draw method included in this API file creates I-joist floor assemblies, while the remaining public methods provide validation, movement, regeneration, and attribute read/write access for existing floor assemblies.

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

Medeek_Engineering_Inc_Extensions::
  MedeekFloorPlugin::
  Floor::
  MedeekMethods


ijoist_floor_draw

Creates a new I-joist floor assembly from a polygon of points or from a selected face.

Syntax

ijoist_floor_draw(pts = nil, ijoistfamily = 'TJI Floor', ijoisttype = 'TJI 110-11.875', joistdir = 0, joistspacing = 16.0)

Parameters

  • pts - Polygon boundary input. May be omitted, a SketchUp face, or an array of points such as [[x,y,z], [x,y,z], ...]
  • ijoistfamily - I-joist family name. Valid options include: 'TJI Floor', 'BCI Floor', 'LPI Floor', 'Red-I Floor', 'PKI Floor', 'RFPI Floor', 'Nordic Floor', 'PWI Floor', 'ACJ Floor'
  • ijoisttype - I-joist type designation
  • joistdir - Joist direction flag
  • joistspacing - Joist spacing in inches

Examples:

mod = Medeek_Engineering_Inc_Extensions::
      MedeekFloorPlugin::
      Floor::
      MedeekMethods

mod.ijoist_floor_draw
pts = [[48,48,0], [240,48,0], [240,240,0], [48,240,0]]

mod = Medeek_Engineering_Inc_Extensions::
      MedeekFloorPlugin::
      Floor::
      MedeekMethods

mod.ijoist_floor_draw(pts)
pts = [[48,48,0], [240,48,0], [240,240,0], [48,240,0]]

mod = Medeek_Engineering_Inc_Extensions::
      MedeekFloorPlugin::
      Floor::
      MedeekMethods

mod.ijoist_floor_draw(pts, 'TJI Floor', 'TJI 110-11.875', 0, 16.0)

Notes

  • If pts is omitted, the method will attempt to use the current model selection.
  • The selection may be a valid SketchUp face that defines the floor polygon.
  • This method requires the Medeek Floor plugin to be installed and fully licensed.

lumber_floor_draw

Creates a new dimensional lumber floor assembly from a polygon of points or from a selected face.

Syntax

lumber_floor_draw(pts = nil, lumberjoisttype = 'LUMBER', joistdepth = 9.25, joistwidth = 1.5, joistdir = 0, joistspacing = 16.0)

Parameters

  • pts - Polygon boundary input. May be omitted, a SketchUp face, or an array of points such as [[x,y,z], [x,y,z], ...]
  • lumberjoisttype - Lumber joist type. Valid options include: 'LUMBER', 'LUMBERPT'
  • joistdepth - Joist depth in inches
  • joistwidth - Joist width in inches
  • joistdir - Joist direction flag
  • joistspacing - Joist spacing in inches

Examples:

mod = Medeek_Engineering_Inc_Extensions::
      MedeekFloorPlugin::
      Floor::
      MedeekMethods

mod.lumber_floor_draw
pts = [[48,48,0], [240,48,0], [240,240,0], [48,240,0]]

mod = Medeek_Engineering_Inc_Extensions::
      MedeekFloorPlugin::
      Floor::
      MedeekMethods

mod.lumber_floor_draw(pts)
pts = [[48,48,0], [240,48,0], [240,240,0], [48,240,0]]

mod = Medeek_Engineering_Inc_Extensions::
      MedeekFloorPlugin::
      Floor::
      MedeekMethods

mod.lumber_floor_draw(pts, 'LUMBER', 9.25, 1.5, 0, 16.0)

Notes

  • If pts is omitted, the method will attempt to use the current model selection.
  • The selection may be a valid SketchUp face that defines the floor polygon.
  • The joistdepth value must be numeric and between 1.5 and 48.0 inches.
  • The joistwidth value must be numeric and between 0.25 and 24.0 inches.
  • The joistdir value must be either 0 or 90.
  • The joistspacing value must be numeric and between 4.0 and 144.0 inches.
  • This method requires the Medeek Floor plugin to be installed and fully licensed.

truss_floor_draw

Creates a new floor truss assembly from a polygon of points or from a selected face.

Syntax

truss_floor_draw(pts = nil, trussdepth = 24.0, trussply = 3.5, trusspanel = 28.0, trussbearingleft = 'B', trussbearingright = 'B', joistdir = 0, joistspacing = 16.0)

Parameters

  • pts - Polygon boundary input. May be omitted, a SketchUp face, or an array of points such as [[x,y,z], [x,y,z], ...]
  • trussdepth - Floor truss depth in inches
  • trussply - Floor truss ply/width in inches
  • trusspanel - Floor truss panel length in inches
  • trussbearingleft - Left bearing type. Valid options include: 'T', 'B'
  • trussbearingright - Right bearing type. Valid options include: 'T', 'B'
  • joistdir - Joist direction flag
  • joistspacing - Joist spacing in inches

Examples:

mod = Medeek_Engineering_Inc_Extensions::
      MedeekFloorPlugin::
      Floor::
      MedeekMethods

mod.truss_floor_draw
pts = [[48,48,0], [240,48,0], [240,240,0], [48,240,0]]

mod = Medeek_Engineering_Inc_Extensions::
      MedeekFloorPlugin::
      Floor::
      MedeekMethods

mod.truss_floor_draw(pts)
pts = [[48,48,0], [240,48,0], [240,240,0], [48,240,0]]

mod = Medeek_Engineering_Inc_Extensions::
      MedeekFloorPlugin::
      Floor::
      MedeekMethods

mod.truss_floor_draw(pts, 24.0, 3.5, 28.0, 'B', 'B', 0, 16.0)

Notes

  • If pts is omitted, the method will attempt to use the current model selection.
  • The selection may be a valid SketchUp face that defines the floor polygon.
  • The trussdepth value must be numeric and between 8.0 and 96.0 inches.
  • The trussply value must be numeric and between 1.5 and 16.0 inches.
  • The trusspanel value must be numeric and between 12.0 and 60.0 inches.
  • The trussbearingleft and trussbearingright values must be either 'T' or 'B'.
  • The joistdir value must be either 0 or 90.
  • The joistspacing value must be numeric and between 4.0 and 144.0 inches.
  • This method requires the Medeek Floor plugin to be installed and fully licensed.

validate_medeekfloor

Validates that the provided group represents a Medeek Floor assembly.

Syntax

validate_medeekfloor(group)

Parameters

  • group - Floor group name or SketchUp group object

Returns

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

Example

Medeek_Engineering_Inc_Extensions::MedeekFloorPlugin::Floor::MedeekMethods.validate_medeekfloor('FLOOR_POLYGON_ASSEMBLY_2024110823301222')

floor_move

Moves one edge of an existing Medeek Floor assembly by the specified offset distance.

Syntax

floor_move(group = nil, edgenum = 1, deltay = 48.0)

Parameters

  • group - Floor group name or SketchUp group object (optional)
  • edgenum - Edge number to move, starting at 1
  • deltay - Offset distance for the selected edge

Examples

Medeek_Engineering_Inc_Extensions::MedeekFloorPlugin::Floor::MedeekMethods.floor_move(1, 48.0)
Medeek_Engineering_Inc_Extensions::MedeekFloorPlugin::Floor::MedeekMethods.floor_move('FLOOR_POLYGON_ASSEMBLY_2024110823301222', 1, 48.0)

Notes

  • If no floor group is supplied, the current selection set will be checked for a valid floor assembly.
  • The edgenum value must be an integer and must correspond to an existing edge in the floor polygon.
  • The deltay value must be numeric and non-zero.
  • A shorthand call is supported when a floor assembly is already selected: floor_move(edgenum, deltay).

floor_regen

Regenerates an existing Medeek Floor assembly.

Syntax

floor_regen(group = nil)

Parameters

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

Examples

Medeek_Engineering_Inc_Extensions::MedeekFloorPlugin::Floor::MedeekMethods.floor_regen
Medeek_Engineering_Inc_Extensions::MedeekFloorPlugin::Floor::MedeekMethods.floor_regen('FLOOR_POLYGON_ASSEMBLY_2024110823301222')

Notes

  • If no floor group is supplied, the current selection set will be checked for a valid floor assembly.
  • Use this method after making manual edits to stored floor attributes when you want the assembly redrawn from its saved parameters.

floor_read_attributes

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

Syntax

floor_read_attributes(group = nil)

Parameters

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

Returns

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

Examples

Medeek_Engineering_Inc_Extensions::MedeekFloorPlugin::Floor::MedeekMethods.floor_read_attributes
Medeek_Engineering_Inc_Extensions::MedeekFloorPlugin::Floor::MedeekMethods.floor_read_attributes('FLOOR_POLYGON_ASSEMBLY_2024110823301222')

Notes

  • Use this method when you need to inspect all available floor settings/parameters.
  • This method is only intended for reading floor configuration data; it does not alter the model or the floor assembly.
  • If no floor group name is supplied the selection set in the model will be analyzed to determine if a floor assembly has been selected.
  • The returned data is organized into nested libraries such as BASIC, IJOIST, LUMBER, TRUSS, ADVANCED, HANGER, BRIDGING, BLOCKING, DECK, STEELDECK, and ROOF.

floor_get_attribute

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

Syntax

floor_get_attribute(param, group = nil)

Parameters

  • param - The name of the attribute/parameter to read
  • group - Floor 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 Floor assembly
  • nil if the requested parameter has no stored value

Examples

Medeek_Engineering_Inc_Extensions::MedeekFloorPlugin::Floor::MedeekMethods.floor_get_attribute('JOISTSPACING')
Medeek_Engineering_Inc_Extensions::MedeekFloorPlugin::Floor::MedeekMethods.floor_get_attribute('JOISTSPACING', 'FLOOR_POLYGON_ASSEMBLY_2024110823301222')

Notes

  • This method is useful when querying one specific parameter without reading the entire floor attribute library.
  • The parameter name is normalized to uppercase before lookup.
  • This method is only intended for reading floor configuration data; it does not alter the model or the floor assembly.
  • If no floor group name is supplied the selection set in the model will be analyzed to determine if a floor assembly has been selected.

floor_set_attribute

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

Syntax

floor_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 - Floor group name or SketchUp group object (optional)
  • regen flag - Set to true or false in order to regenerate 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 Floor assembly
  • false if the requested attribute cannot be updated

Examples

Medeek_Engineering_Inc_Extensions::MedeekFloorPlugin::Floor::MedeekMethods.floor_set_attribute('JOISTSPACING', 24.0)
Medeek_Engineering_Inc_Extensions::MedeekFloorPlugin::Floor::MedeekMethods.floor_set_attribute('JOISTSPACING', 24.0, true)
Medeek_Engineering_Inc_Extensions::MedeekFloorPlugin::Floor::MedeekMethods.floor_set_attribute('JOISTSPACING', 24.0, 'FLOOR_POLYGON_ASSEMBLY_2024110823301222')
Medeek_Engineering_Inc_Extensions::MedeekFloorPlugin::Floor::MedeekMethods.floor_set_attribute('JOISTSPACING', 24.0, 'FLOOR_POLYGON_ASSEMBLY_2024110823301222', true)

Notes

  • Use this method when you need to modify a single floor setting/parameter.
  • The parameter name is normalized to uppercase before lookup.
  • This method only updates the specified floor attribute/parameter; it does not automatically redraw or regenerate the floor assembly unless the regen flag is set to true.
  • If no floor group name is supplied the selection set in the model will be analyzed to determine if a floor assembly has been selected.
  • A shorthand call is supported when working on the current selection: floor_set_attribute(param, value, true).