Class: Sketchup::LineStyles

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

Overview

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

Version:

  • SketchUp 2019

Instance Method Summary collapse

Methods inherited from Entity

#add_observer, #attribute_dictionaries, #attribute_dictionary, #delete_attribute, #deleted?, #entityID, #get_attribute, #inspect, #model, #parent, #persistent_id, #remove_observer, #set_attribute, #to_s, #typename, #valid?

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 (Index)

      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 retrived.

Version:

  • SketchUp 2019



37
38
# File 'lib/sketchup-api-stubs/stubs/Sketchup/LineStyles.rb', line 37

def [](arg)
end

#[](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 (Index)

      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 retrived.

Version:

  • SketchUp 2019



62
63
# File 'lib/sketchup-api-stubs/stubs/Sketchup/LineStyles.rb', line 62

def at(arg)
end

#eachnil

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 }

Returns:

  • (nil)

Version:

  • SketchUp 2019



74
75
# File 'lib/sketchup-api-stubs/stubs/Sketchup/LineStyles.rb', line 74

def each
end

#namesArray<String>

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

Returns:

Version:

  • SketchUp 2019



85
86
# File 'lib/sketchup-api-stubs/stubs/Sketchup/LineStyles.rb', line 85

def names
end

#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



97
98
# File 'lib/sketchup-api-stubs/stubs/Sketchup/LineStyles.rb', line 97

def size
end

#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



109
110
# File 'lib/sketchup-api-stubs/stubs/Sketchup/LineStyles.rb', line 109

def to_a
end