123456789_123456789_123456789_123456789_123456789_

Class: Sketchup::Classifications

Relationships
Super Chains via Extension / Inclusion / Inheritance
Instance Chain:
self, Enumerable
Inherits: Object

Overview

The Classifications class is a container/manager for all classifications in a model.

Version:

  • SketchUp 2015

Instance Method Summary

Instance Method Details

#[](index_or_name) ⇒ Object

The [] method is used to get a classification schema by name or index.

Examples:

# Get schema by name:
schema = Sketchup.active_model.classifications["IFC 2x3"]

# Get schema by index:
schema = Sketchup.active_model.classifications[1]

Parameters:

Returns:

Version:

  • SketchUp 2015

#each {|schema| ... } ⇒ nil

The #each method is used to iterate through loaded classification schemas.

Examples:

Sketchup.active_model.classifications.each { |schema|
  puts schema.name
}

Yield Parameters:

Version:

  • SketchUp 2015

#keysObject

The keys method is used to get a list of keys in the Classifications class, which are the same as the names of the schemas.

Examples:

schema_names = Sketchup.active_model.classifications.keys

Returns:

Version:

  • SketchUp 2015

#lengthInteger

The #length method returns the number of loaded classification schemas.

See Also:

Version:

  • SketchUp 2015

#load_schema(file) ⇒ Object

The load_schema method is used to load a classification schema into a model.

Examples:

c = Sketchup.active_model.classifications
file = Sketchup.find_support_file('IFC 4.skc', 'Classifications')
status = c.load_schema(file) if !file.nil?

Parameters:

  • file

    Full path to the schema file

Returns:

  • True if successful.

Version:

  • SketchUp 2015

#sizeInteger

The #size method returns the number of loaded classification schemas.

See Also:

Version:

  • SketchUp 2015

#unload_schema(schema_name) ⇒ Object

The unload_schema method is used to unload a classification schema that was previously loaded into a model.

Examples:

c = Sketchup.active_model.classifications
status = c.unload_schema('IFC 2x3')

Parameters:

  • schema_name

    Name of the schema to unload

Returns:

  • True if successful.

Version:

  • SketchUp 2015