# Class: EnfEditor::EEComponent

Inherits:
  EEElementOwner
  - Object
  - EEBase
  - EEElement
  - EEElementOwner
  - EnfEditor::EEComponent
  show all

Includes:
  PropertyName, UserPropertyUtils

Defined in:
  lib/enfeditor/core_ext/ee_component.rb,
  ext/enfhandler/EnfHandler_wrap2.cxx

## Overview

Proxy of C++ EnfEditor::EEComponent class

## Component System properties collapse

- #bin_name ⇒ String?

  Getter for bin_name.

- #bin_name=(value) ⇒ Object

  Setter for bin_name.

- #change_history ⇒ String?

  Getter for change_history.

- #change_history=(value) ⇒ Object

  Setter for change_history.

- #config_name ⇒ String?

  Getter for config_name.

- #config_name=(value) ⇒ Object

  Setter for config_name.

- #description ⇒ String?

  Getter for description.

- #description=(value) ⇒ Object

  Setter for description.

- #material ⇒ String?

  Getter for material.

- #material=(value) ⇒ Object

  Setter for material.

- #native_file_name ⇒ String?

  Getter for native file name.

- #native_file_name=(value) ⇒ Object

  Setter for native file name.

- #part_comment ⇒ String?

  Getter for part_comment.

- #part_comment=(value) ⇒ Object

  Setter for part_comment.

- #part_definition ⇒ String?

  Getter for part_definition.

- #part_definition=(value) ⇒ Object

  Setter for part_definition.

- #part_layer ⇒ String?

  Getter for part_layer.

- #part_layer=(value) ⇒ Object

  Setter for part_layer.

- #part_name ⇒ String?

  Getter for part_name.

- #part_name=(value) ⇒ Object

  Setter for part_name.

- #part_number ⇒ String?

  Getter for part_number.

- #part_number=(value) ⇒ Object

  Setter for part_number.

- #part_revision ⇒ String?

  Getter for part_revision.

- #part_revision=(value) ⇒ Object

  Setter for part_revision.

- #part_source ⇒ String?

  Getter for part_source.

- #part_source=(value) ⇒ Object

  Setter for part_source.

- #part_version ⇒ String?

  Getter for part_version.

- #part_version=(value) ⇒ Object

  Setter for part_version.

- #target_file_name ⇒ String?

  Getter for target file name.

- #target_file_name=(value) ⇒ Object

  Setter for target file name.

## Instance Method Summary collapse

- #annotations ⇒ Array<EEAnnotation>

  Getter for Annotation.

- #assembly? ⇒ Boolean

  Returns true if the component is assembly.

- #child_instances ⇒ Array<EEOccInst>

  Returns child instances.

- #edges ⇒ Array<EEBrepEdge>

  Returns edges in component including isolated edges and edges of isolated faces.

- #faces ⇒ Array<EEBrepFace>

  Returns faces in component including isolated faces.

- #isolated_edges ⇒ Array<EEBrepEdge>

  Returns isolated edges in component.

- #isolated_faces ⇒ Array<EEBrepFace>

  Returns isolated faces in component.

- #isolated_vertices ⇒ Array<EEBrepVertex>

  Returns isolated vertices in component.

- #part? ⇒ Boolean

  Returns true if the component is part.

- #vertices ⇒ Array<EEBrepVertex>

  Returns vertices in component including isolated vertices and vertices of isolated edges.

- #volumes ⇒ Array<EEBrepVolume>

  Returns volumes in component.

### Methods included from PropertyName

#name, #name=

### Methods included from UserPropertyUtils

#create_user_property, #overwrite_user_property, #user_properties

### Methods inherited from EEElement

#delete!

### Methods inherited from EEBase

#null?

## Instance Method Details

### #annotations ⇒ `Array<EEAnnotation>`

Getter for Annotation

Examples:

    # Get all annotations in component
    component.annotations.each do |annotation|
      puts annotation.name
    end

Returns:

- (`Array<EEAnnotation>`) —

  Returns all annotations in component.

Since:

- 1.0.0.0

    557
    558
    559
    560
    561
    # File 'lib/enfeditor/core_ext/ee_component.rb', line 557

    def annotations
      attrs = []
      attrs.concat occtree_list.map{|occtree| occtree.annotations}.flatten
      attrs.concat comprep_list.map{|comprep| comprep.annotations}.flatten
    end

### #assembly? ⇒ `Boolean`

Returns true if the component is assembly

Examples:

    # Log if the component type is assembly.
    puts "#{component.name} is assembly" if component.assembly?
    # => Assy_1 is assembly

Returns:

- (`Boolean`) —

  Returns true if the component is assembly

Since:

- 0.1.0.0

    370
    371
    372
    # File 'lib/enfeditor/core_ext/ee_component.rb', line 370

    def assembly?
      component_type == "ASSEMBLY"
    end

### #bin_name ⇒ `String`?

Getter for bin_name

Examples:

    # Get property value
    puts component.bin_name

Returns:

- (`String`, `nil`) —

  Returns string value or nil if not exist.

Since:

- 0.1.0.0

    # File 'lib/enfeditor/core_ext/ee_component.rb', line 303

### #bin_name=(value) ⇒ `Object`

Setter for bin_name

Examples:

    # Set property value
    component.bin_name = 'hoge'

Parameters:

- value (`String`, `nil`) —

  New value or set nil to remove property.

Since:

- 0.1.0.0

    # File 'lib/enfeditor/core_ext/ee_component.rb', line 312

### #change_history ⇒ `String`?

Getter for change_history

Examples:

    # Get property value
    puts component.change_history

Returns:

- (`String`, `nil`) —

  Returns string value or nil if not exist.

Since:

- 0.1.0.0

    # File 'lib/enfeditor/core_ext/ee_component.rb', line 267

### #change_history=(value) ⇒ `Object`

Setter for change_history

Examples:

    # Set property value
    component.change_history = 'hoge'

Parameters:

- value (`String`, `nil`) —

  New value or set nil to remove property.

Since:

- 0.1.0.0

    # File 'lib/enfeditor/core_ext/ee_component.rb', line 276

### #child_instances ⇒ `Array<EEOccInst>`

Returns child instances.

Examples:

    component.child_instances.each do |instance|
      p instance.name
    end

Returns:

- (`Array<EEOccInst>`) —

  Returns child instances.

Since:

- 0.7.0.0

    381
    382
    383
    # File 'lib/enfeditor/core_ext/ee_component.rb', line 381

    def child_instances
      occtree_list.first.root_occurrence.children
    end

### #config_name ⇒ `String`?

Getter for config_name

Examples:

    # Get property value
    puts component.config_name

Returns:

- (`String`, `nil`) —

  Returns string value or nil if not exist.

Since:

- 0.1.0.0

    # File 'lib/enfeditor/core_ext/ee_component.rb', line 69

### #config_name=(value) ⇒ `Object`

Setter for config_name

Examples:

    # Set property value
    component.config_name = 'hoge'

Parameters:

- value (`String`, `nil`) —

  New value or set nil to remove property.

Since:

- 0.1.0.0

    # File 'lib/enfeditor/core_ext/ee_component.rb', line 78

### #description ⇒ `String`?

Getter for description

Examples:

    # Get property value
    puts component.description

Returns:

- (`String`, `nil`) —

  Returns string value or nil if not exist.

Since:

- 0.1.0.0

    # File 'lib/enfeditor/core_ext/ee_component.rb', line 51

### #description=(value) ⇒ `Object`

Setter for description

Examples:

    # Set property value
    component.description = 'hoge'

Parameters:

- value (`String`, `nil`) —

  New value or set nil to remove property.

Since:

- 0.1.0.0

    # File 'lib/enfeditor/core_ext/ee_component.rb', line 60

### #edges ⇒ `Array<EEBrepEdge>`

Returns edges in component including isolated edges and edges of isolated faces.

Examples:

    # Set layer number of all the edges in component to 3
    component.edges.each do |edge|
      edge.layer = 3
    end

Returns:

- (`Array<EEBrepEdge>`) —

  Returns edges in component including isolated edges and edges of isolated faces.

Since:

- 0.1.0.0

    430
    431
    432
    433
    434
    435
    436
    437
    # File 'lib/enfeditor/core_ext/ee_component.rb', line 430

    def edges
      comprep_list.each do |comprep|
        if comprep.type == :brep
          return comprep.edges
        end
      end
      return []
    end

### #faces ⇒ `Array<EEBrepFace>`

Returns faces in component including isolated faces.

Examples:

    # Set layer number of all the faces in component to 3
    component.faces.each do |face|
      face.layer = 3
    end

Returns:

- (`Array<EEBrepFace>`) —

  Returns faces in component including isolated faces.

Since:

- 0.1.0.0

    413
    414
    415
    416
    417
    418
    419
    420
    # File 'lib/enfeditor/core_ext/ee_component.rb', line 413

    def faces
      comprep_list.each do |comprep|
        if comprep.type == :brep
          return comprep.faces
        end
      end
      return []
    end

### #isolated_edges ⇒ `Array<EEBrepEdge>`

Returns isolated edges in component.

Examples:

    # Set layer number of all the isolated edges to 3
    component.isolated_edges.each do |elem|
      elem.layer = 3
    end

Returns:

- (`Array<EEBrepEdge>`) —

  Returns isolated edges in component.

Since:

- 0.1.0.0

    481
    482
    483
    484
    485
    486
    487
    488
    # File 'lib/enfeditor/core_ext/ee_component.rb', line 481

    def isolated_edges
      comprep_list.each do |comprep|
        if comprep.type == :brep
          return comprep.isolated_edges
        end
      end
      return []
    end

### #isolated_faces ⇒ `Array<EEBrepFace>`

Returns isolated faces in component.

Examples:

    # Set layer number of all the isolated faces to 3
    component.isolated_faces.each do |elem|
      elem.layer = 3
    end

Returns:

- (`Array<EEBrepFace>`) —

  Returns isolated faces in component.

Since:

- 0.1.0.0

    464
    465
    466
    467
    468
    469
    470
    471
    # File 'lib/enfeditor/core_ext/ee_component.rb', line 464

    def isolated_faces
      comprep_list.each do |comprep|
        if comprep.type == :brep
          return comprep.isolated_faces
        end
      end
      return []
    end

### #isolated_vertices ⇒ `Array<EEBrepVertex>`

Returns isolated vertices in component.

Examples:

    # Set layer number of all the isolated vertices to 3
    component.isolated_vertices.each do |elem|
      elem.layer = 3
    end

Returns:

- (`Array<EEBrepVertex>`) —

  Returns isolated vertices in component.

Since:

- 0.1.0.0

    498
    499
    500
    501
    502
    503
    504
    505
    # File 'lib/enfeditor/core_ext/ee_component.rb', line 498

    def isolated_vertices
      comprep_list.each do |comprep|
        if comprep.type == :brep
          return comprep.isolated_vertices
        end
      end
      return []
    end

### #material ⇒ `String`?

Getter for material

Examples:

    # Get property value
    puts component.material

Returns:

- (`String`, `nil`) —

  Returns string value or nil if not exist.

Since:

- 0.1.0.0

    # File 'lib/enfeditor/core_ext/ee_component.rb', line 285

### #material=(value) ⇒ `Object`

Setter for material

Examples:

    # Set property value
    component.material = 'hoge'

Parameters:

- value (`String`, `nil`) —

  New value or set nil to remove property.

Since:

- 0.1.0.0

    # File 'lib/enfeditor/core_ext/ee_component.rb', line 294

### #native_file_name ⇒ `String`?

Getter for native file name

Examples:

    # Get property value
    puts component.native_file_name

Returns:

- (`String`, `nil`) —

  Returns string value or nil if it doesn't exist.

Since:

- 0.1.0.0

    # File 'lib/enfeditor/core_ext/ee_component.rb', line 15

### #native_file_name=(value) ⇒ `Object`

Setter for native file name

Examples:

    # Set property value
    component.native_file_name = 'c:/a.prt'

Parameters:

- value (`String`, `nil`) —

  New value or set nil to remove property.

Since:

- 0.1.0.0

    # File 'lib/enfeditor/core_ext/ee_component.rb', line 24

### #part? ⇒ `Boolean`

Returns true if the component is part

Examples:

    # Log if the component type is part.
    puts "#{component.name} is part" if component.part?
    # => Part_1 is part

Returns:

- (`Boolean`) —

  Returns true if the component is part

Since:

- 0.1.0.0

    359
    360
    361
    # File 'lib/enfeditor/core_ext/ee_component.rb', line 359

    def part?
      component_type == "PART"
    end

### #part_comment ⇒ `String`?

Getter for part_comment

Examples:

    # Get property value
    puts component.part_comment

Returns:

- (`String`, `nil`) —

  Returns string value or nil if not exist.

Since:

- 0.1.0.0

    # File 'lib/enfeditor/core_ext/ee_component.rb', line 87

### #part_comment=(value) ⇒ `Object`

Setter for part_comment

Examples:

    # Set property value
    component.part_comment = 'hoge'

Parameters:

- value (`String`, `nil`) —

  New value or set nil to remove property.

Since:

- 0.1.0.0

    # File 'lib/enfeditor/core_ext/ee_component.rb', line 96

### #part_definition ⇒ `String`?

Getter for part_definition

Examples:

    # Get property value
    puts component.part_definition

Returns:

- (`String`, `nil`) —

  Returns string value or nil if not exist.

Since:

- 0.1.0.0

    # File 'lib/enfeditor/core_ext/ee_component.rb', line 105

### #part_definition=(value) ⇒ `Object`

Setter for part_definition

Examples:

    # Set property value
    component.part_definition = 'hoge'

Parameters:

- value (`String`, `nil`) —

  New value or set nil to remove property.

Since:

- 0.1.0.0

    # File 'lib/enfeditor/core_ext/ee_component.rb', line 114

### #part_layer ⇒ `String`?

Getter for part_layer

Examples:

    # Get property value
    puts component.part_layer

Returns:

- (`String`, `nil`) —

  Returns string value or nil if not exist.

Since:

- 0.1.0.0

    # File 'lib/enfeditor/core_ext/ee_component.rb', line 249

### #part_layer=(value) ⇒ `Object`

Setter for part_layer

Examples:

    # Set property value
    component.part_layer = 'hoge'

Parameters:

- value (`String`, `nil`) —

  New value or set nil to remove property.

Since:

- 0.1.0.0

    # File 'lib/enfeditor/core_ext/ee_component.rb', line 258

### #part_name ⇒ `String`?

Getter for part_name

Examples:

    # Get property value
    puts component.part_name

Returns:

- (`String`, `nil`) —

  Returns string value or nil if not exist.

Since:

- 0.1.0.0

    # File 'lib/enfeditor/core_ext/ee_component.rb', line 159

### #part_name=(value) ⇒ `Object`

Setter for part_name

Examples:

    # Set property value
    component.part_name = 'hoge'

Parameters:

- value (`String`, `nil`) —

  New value or set nil to remove property.

Since:

- 0.1.0.0

    # File 'lib/enfeditor/core_ext/ee_component.rb', line 168

### #part_number ⇒ `String`?

Getter for part_number

Examples:

    # Get property value
    puts component.part_number

Returns:

- (`String`, `nil`) —

  Returns string value or nil if not exist.

Since:

- 0.1.0.0

    # File 'lib/enfeditor/core_ext/ee_component.rb', line 177

### #part_number=(value) ⇒ `Object`

Setter for part_number

Examples:

    # Set property value
    component.part_number = 'hoge'

Parameters:

- value (`String`, `nil`) —

  New value or set nil to remove property.

Since:

- 0.1.0.0

    # File 'lib/enfeditor/core_ext/ee_component.rb', line 186

### #part_revision ⇒ `String`?

Getter for part_revision

Examples:

    # Get property value
    puts component.part_revision

Returns:

- (`String`, `nil`) —

  Returns string value or nil if not exist.

Since:

- 0.1.0.0

    # File 'lib/enfeditor/core_ext/ee_component.rb', line 213

### #part_revision=(value) ⇒ `Object`

Setter for part_revision

Examples:

    # Set property value
    component.part_revision = 'hoge'

Parameters:

- value (`String`, `nil`) —

  New value or set nil to remove property.

Since:

- 0.1.0.0

    # File 'lib/enfeditor/core_ext/ee_component.rb', line 222

### #part_source ⇒ `String`?

Getter for part_source

Examples:

    # Get property value
    puts component.part_source

Returns:

- (`String`, `nil`) —

  Returns string value or nil if not exist.

Since:

- 0.1.0.0

    # File 'lib/enfeditor/core_ext/ee_component.rb', line 231

### #part_source=(value) ⇒ `Object`

Setter for part_source

Examples:

    # Set property value
    component.part_source = 'hoge'

Parameters:

- value (`String`, `nil`) —

  New value or set nil to remove property.

Since:

- 0.1.0.0

    # File 'lib/enfeditor/core_ext/ee_component.rb', line 240

### #part_version ⇒ `String`?

Getter for part_version

Examples:

    # Get property value
    puts component.part_version

Returns:

- (`String`, `nil`) —

  Returns string value or nil if not exist.

Since:

- 0.1.0.0

    # File 'lib/enfeditor/core_ext/ee_component.rb', line 195

### #part_version=(value) ⇒ `Object`

Setter for part_version

Examples:

    # Set property value
    component.part_version = 'hoge'

Parameters:

- value (`String`, `nil`) —

  New value or set nil to remove property.

Since:

- 0.1.0.0

    # File 'lib/enfeditor/core_ext/ee_component.rb', line 204

### #target_file_name ⇒ `String`?

Getter for target file name

Examples:

    # Get property value
    puts component.target_file_name

Returns:

- (`String`, `nil`) —

  Returns string value or nil if it doesn't exist.

Since:

- 0.1.0.0

    # File 'lib/enfeditor/core_ext/ee_component.rb', line 33

### #target_file_name=(value) ⇒ `Object`

Setter for target file name

Examples:

    # Set property value
    component.target_file_name = 'c:/a.prt'

Parameters:

- value (`String`, `nil`) —

  New value or set nil to remove property.

Since:

- 0.1.0.0

    # File 'lib/enfeditor/core_ext/ee_component.rb', line 42

### #vertices ⇒ `Array<EEBrepVertex>`

Returns vertices in component including isolated vertices and vertices of isolated edges.

Examples:

    # Set layer number of all the vertices in component to 3
    component.vertices.each do |vertex|
      vertex.layer = 3
    end

Returns:

- (`Array<EEBrepVertex>`) —

  Returns vertices in component including isolated vertices and vertices of isolated edges.

Since:

- 0.1.0.0

    447
    448
    449
    450
    451
    452
    453
    454
    # File 'lib/enfeditor/core_ext/ee_component.rb', line 447

    def vertices
      comprep_list.each do |comprep|
        if comprep.type == :brep
          return comprep.vertices
        end
      end
      return []
    end

### #volumes ⇒ `Array<EEBrepVolume>`

Returns volumes in component.

Examples:

    # Set layer number of all the volumes in component to 3
    component.volumes.each do |volume|
      volume.layer = 3
    end

Returns:

- (`Array<EEBrepVolume>`) —

  Returns volumes in component.

Since:

- 0.1.0.0

    396
    397
    398
    399
    400
    401
    402
    403
    # File 'lib/enfeditor/core_ext/ee_component.rb', line 396

    def volumes
      comprep_list.each do |comprep|
        if comprep.type == :brep
          return comprep.volumes
        end
      end
      return []
    end