Class: Sketchup::Classifications

Inherits:
Object
  • Object
show all
Includes:
Enumerable
Defined in:
lib/sketchup-api-stubs/stubs/Sketchup/Classifications.rb

Overview

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

Version:

  • SketchUp 2015

Instance Method Summary collapse

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:

  • index_or_name

    The index or name of the ClassificationSchema object.

Returns:

  • schema - a ClassificationSchema object if successful, otherwise nil.

Version:

  • SketchUp 2015



32
33
# File 'lib/sketchup-api-stubs/stubs/Sketchup/Classifications.rb', line 32

def [](index_or_name)
end

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

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

Examples:

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

Yields:

  • (schema)

    A variable that will hold each ClassificationSchema object as they are found.

Returns:

  • nil

Version:

  • SketchUp 2015



48
49
# File 'lib/sketchup-api-stubs/stubs/Sketchup/Classifications.rb', line 48

def each
end

#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:

  • keys - Array of string keys

Version:

  • SketchUp 2015



60
61
# File 'lib/sketchup-api-stubs/stubs/Sketchup/Classifications.rb', line 60

def keys
end

#lengthInteger

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

Returns:

  • (Integer)

See Also:

Version:

  • SketchUp 2015



73
74
# File 'lib/sketchup-api-stubs/stubs/Sketchup/Classifications.rb', line 73

def length
end

#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



90
91
# File 'lib/sketchup-api-stubs/stubs/Sketchup/Classifications.rb', line 90

def load_schema(file)
end

#sizeInteger

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

Returns:

  • (Integer)

See Also:

Version:

  • SketchUp 2015



103
104
# File 'lib/sketchup-api-stubs/stubs/Sketchup/Classifications.rb', line 103

def size
end

#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



119
120
# File 'lib/sketchup-api-stubs/stubs/Sketchup/Classifications.rb', line 119

def unload_schema(schema_name)
end