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]

Version:

  • SketchUp 2015



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

def [](index_or_name)
end

#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



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

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

Version:

  • SketchUp 2015



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

def keys
end

#lengthInteger

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

Examples:

Sketchup.active_model.classifications.length

See Also:

Version:

  • SketchUp 2015



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

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?

Version:

  • SketchUp 2015



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

def load_schema(file)
end

#sizeInteger

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

Examples:

Sketchup.active_model.classifications.size

See Also:

Version:

  • SketchUp 2015



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

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')

Version:

  • SketchUp 2015



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

def unload_schema(schema_name)
end