DefinitionList

class

Introduction

A DefinitionList object holds a list of all of the ComponentDefinition
objects in a model. This class contains methods for adding and retrieving
definitions from the list.

Methods

DefinitionList.[]SketchUp 6.0+

The [] method is used to retrieve a component definition from the list. You
can give an integer index in the range 0 to length, a string which
represents the GUID (a unique internal identifier), or a string that is
the name of the definition.

Arguments:

key

The index for a specific component definition, the unique GUID for the component definition, or the name of an existing component definition.

The load_from_url method loads a component from a location specified by
string url. This method throws an exception if an url string is not
given, or an error occurs during retrieval from url and a
load_handler was not given. Optional second parameter load_handler can be
used to pass in a ruby object that responds to the following methods:

cancelled?(a_boolean)

onPercentChange(a_float)

onSuccess()

onFailure(message_string)

Arguments:

url

URL to load a .skp file from.

load_handler

(optional) Ruby object that has methods defined as described in the load_from_url details.