Class: EnfEditor::EEComponent

Inherits:
EEElementOwner 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

Instance Method Summary collapse

Methods included from PropertyName

#name, #name=

Methods included from UserPropertyUtils

#create_user_property, #user_properties

Methods inherited from EEElement

#delete!

Methods inherited from EEBase

#null?

Instance Method Details

#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_nameString?

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_historyString?

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_instancesArray<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_nameString?

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

#descriptionString?

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

#edgesArray<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

#facesArray<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_edgesArray<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_facesArray<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_verticesArray<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

#materialString?

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_nameString?

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_commentString?

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_definitionString?

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_layerString?

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_nameString?

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_numberString?

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_revisionString?

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_sourceString?

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_versionString?

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_nameString?

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

#verticesArray<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

#volumesArray<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:

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