Overview

The Medeek Foundation API allows developers and advanced users to programmatically create and manipulate Medeek Slab-on-Grade foundation assemblies inside SketchUp using Ruby.

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

Medeek_Engineering_Inc_Extensions::
  MedeekFoundationPlugin::
  Sog::
  MedeekMethods


sog_draw

Creates a new polygon slab-on-grade foundation assembly from a selected face, a SketchUp face object, or an array of points.

Syntax

sog_draw(pts = nil)

Parameters

  • 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.

Examples:

mod = Medeek_Engineering_Inc_Extensions::
      MedeekFoundationPlugin::
      Sog::
      MedeekMethods

mod.sog_draw
mod = Medeek_Engineering_Inc_Extensions::
      MedeekFoundationPlugin::
      Sog::
      MedeekMethods

face = Sketchup.active_model.selection.grep(Sketchup::Face)[0]
mod.sog_draw(face)
mod = Medeek_Engineering_Inc_Extensions::
      MedeekFoundationPlugin::
      Sog::
      MedeekMethods

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

validate_medeeksog

Validates that the provided group represents a Medeek Slab-on-Grade assembly.

Syntax

validate_medeeksog(group)

Parameters

  • group - Slab-on-grade group name or SketchUp group object

Returns

  • true, group - valid Medeek slab-on-grade group
  • false - invalid object

Example

Medeek_Engineering_Inc_Extensions::MedeekFoundationPlugin::Sog::MedeekMethods.validate_medeeksog('FOUNDATION_SOG_POLYGON_ASSEMBLY_20260315133308')

sog_move

Moves an edge of an existing polygon slab-on-grade foundation assembly.

Syntax

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

Parameters

  • group - Slab-on-grade group name or SketchUp group object (optional)
  • edgenum - Edge number to move
  • deltay - Offset distance

Examples

Medeek_Engineering_Inc_Extensions::MedeekFoundationPlugin::Sog::MedeekMethods.sog_move(1, 48.0)
Medeek_Engineering_Inc_Extensions::MedeekFoundationPlugin::Sog::MedeekMethods.sog_move('FOUNDATION_SOG_POLYGON_ASSEMBLY_20260315133308', 1, 48.0)

sog_regen

Regenerates an existing polygon slab-on-grade foundation assembly.

Syntax

sog_regen(group = nil)

Parameters

  • group - Slab-on-grade group name or SketchUp group object (optional)

Example

Medeek_Engineering_Inc_Extensions::MedeekFoundationPlugin::Sog::MedeekMethods.sog_regen
Medeek_Engineering_Inc_Extensions::MedeekFoundationPlugin::Sog::MedeekMethods.sog_regen('FOUNDATION_SOG_POLYGON_ASSEMBLY_20260315133308')

sog_read_attributes

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

Syntax

sog_read_attributes(group = nil)

Parameters

  • group - Slab-on-grade group name or SketchUp group object (optional)

Returns

  • A hash of slab-on-grade attributes when the assembly is valid
  • false or nil if the supplied object is not a valid Medeek Slab-on-Grade assembly

Example

Medeek_Engineering_Inc_Extensions::MedeekFoundationPlugin::Sog::MedeekMethods.sog_read_attributes('FOUNDATION_SOG_POLYGON_ASSEMBLY_20260315133308')

Notes

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

sog_read_attribute

Reads a single stored attribute from an existing Medeek Slab-on-Grade assembly.

Syntax

sog_read_attribute(param, group = nil)

Parameters

  • param - The name of the attribute/parameter to read
  • group - Slab-on-grade 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 Slab-on-Grade assembly
  • nil if the requested attribute does not exist

Examples

Medeek_Engineering_Inc_Extensions::MedeekFoundationPlugin::Sog::MedeekMethods.sog_read_attribute('FDEPTH')
Medeek_Engineering_Inc_Extensions::MedeekFoundationPlugin::Sog::MedeekMethods.sog_read_attribute('FDEPTH', 'FOUNDATION_SOG_POLYGON_ASSEMBLY_20260315133308')

Notes

  • This method is useful when querying one specific parameter without reading the entire foundation attribute library.
  • This method is only intended for reading foundation configuration data, it does not alter the model or the foundation assembly.
  • If no slab-on-grade group name is supplied the selection set in the model will be analyzed to determine if a slab-on-grade assembly has been selected.

sog_set_attribute

Sets a single stored attribute within an existing Medeek Slab-on-Grade assembly.

Syntax

sog_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 - Slab-on-grade 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 Slab-on-Grade assembly
  • false if the requested attribute cannot be updated

Examples

Medeek_Engineering_Inc_Extensions::MedeekFoundationPlugin::Sog::MedeekMethods.sog_set_attribute('FDEPTH', 24.0)
Medeek_Engineering_Inc_Extensions::MedeekFoundationPlugin::Sog::MedeekMethods.sog_set_attribute('FDEPTH', 24.0, true)
Medeek_Engineering_Inc_Extensions::MedeekFoundationPlugin::Sog::MedeekMethods.sog_set_attribute('FDEPTH', 24.0, 'FOUNDATION_SOG_POLYGON_ASSEMBLY_20260315133308')
Medeek_Engineering_Inc_Extensions::MedeekFoundationPlugin::Sog::MedeekMethods.sog_set_attribute('FDEPTH', 24.0, 'FOUNDATION_SOG_POLYGON_ASSEMBLY_20260315133308', true)

Notes

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