123456789_123456789_123456789_123456789_123456789_

Class: Sketchup::LineStyles

Relationships
Super Chains via Extension / Inclusion / Inheritance
Class Chain:
self, Entity
Instance Chain:
self, Enumerable, Entity
Inherits: Sketchup::Entity

Overview

Provides access to the different line style objects in the model.

Version:

  • SketchUp 2019

Instance Attribute Summary

Entity - Inherited

#deleted?

The deleted? method is used to determine if your entity is still valid (not deleted by another script, for example.).

#valid?

The #valid? method is used to determine if your entity is still valid (not deleted by another script, for example).

Instance Method Summary

Entity - Inherited

#add_observer

The add_observer method is used to add an observer to the current object.

#attribute_dictionaries

The attribute_dictionaries method is used to retrieve the AttributeDictionaries collection attached to the entity.

#attribute_dictionary

The attribute_dictionary method is used to retrieve an attribute dictionary with a given name that is attached to an Entity.

#delete_attribute

The #delete_attribute method is used to delete an attribute from an entity.

#entityID

The entityID method is used to retrieve a unique ID assigned to an entity.

#get_attribute

The #get_attribute method is used to retrieve the value of an attribute in the entity’s attribute dictionary.

#inspect

The #inspect method is used to retrieve the string representation of the entity.

#model

The model method is used to retrieve the model for the entity.

#parent

The parent method is used to retrieve the parent of the entity.

#persistent_id

The #persistent_id method is used to retrieve a unique persistent id assigned to an entity.

#remove_observer

The remove_observer method is used to remove an observer from the current object.

#set_attribute

The set attribute is used to set the value of an attribute in an attribute dictionary with the given name.

#to_s

The #to_s method is used to retrieve the string representation of the entity.

#typename

The typename method retrieves the type of the entity, which will be a string such as “Face”, “Edge”, or “Group”.

Instance Method Details

#[](name) ⇒ Sketchup::LineStyle? #[](index) ⇒ Sketchup::LineStyle?

The #[] method lets you retrieve a line style by name or index.

The #at method is an alias of #[].

Examples:

solid_style = Sketchup.active_model.line_styles["Solid Basic"]
line_style = Sketchup.active_model.line_styles[1]

Overloads:

  • #[](name) ⇒ Sketchup::LineStyle?

    Parameters:

    • name (String)

      The name of the line style to retrieve.

  • #[](index) ⇒ Sketchup::LineStyle?

    Parameters:

    • index (Integer)

      The index of the line style to retrieve.

    Raises:

    • (IndexError)

      If index is out of bounds.

Returns:

  • (Sketchup::LineStyle, nil)

    The line style retrieved. nil if the name couldn’t be retrieved.

Version:

  • SketchUp 2019

#[](name) ⇒ Sketchup::LineStyle? #[](index) ⇒ Sketchup::LineStyle?

The #[] method lets you retrieve a line style by name or index.

The #at method is an alias of #[].

Examples:

solid_style = Sketchup.active_model.line_styles["Solid Basic"]
line_style = Sketchup.active_model.line_styles[1]

Overloads:

  • #[](name) ⇒ Sketchup::LineStyle?

    Parameters:

    • name (String)

      The name of the line style to retrieve.

  • #[](index) ⇒ Sketchup::LineStyle?

    Parameters:

    • index (Integer)

      The index of the line style to retrieve.

    Raises:

    • (IndexError)

      If index is out of bounds.

Returns:

  • (Sketchup::LineStyle, nil)

    The line style retrieved. nil if the name couldn’t be retrieved.

Version:

  • SketchUp 2019

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

The #each method is used to iterate through all the line styles.

Examples:

line_styles = Sketchup.active_model.line_styles
line_styles.each{ |line_style| p line_style.name }

Yield Parameters:

Version:

  • SketchUp 2019

#length

Alias for #size.

#namesArray<String>

The #names method return the support line styles as strings.

Version:

  • SketchUp 2019

#sizeInteger Also known as: #length

The #size method returns the number of line styles that SketchUp supports.

Examples:

line_styles = Sketchup.active_model.line_styles
line_styles.size

Returns:

  • (Integer)

    The count of line styles.

Version:

  • SketchUp 2019

#to_aArray

The #to_a method returns an array of all the line styles.

Examples:

line_styles = Sketchup.active_active_model.line_styles.to_a

Returns:

  • (Array)

    Containing all the line style objects.

Version:

  • SketchUp 2019