Class: Autocad::Polyline

Inherits:
Element show all
Defined in:
lib/autocad/line.rb

Instance Attribute Summary

Attributes inherited from Element

#acad_type, #app, #ole_obj, #original

Instance Method Summary collapse

Methods inherited from Element

#[], #app_ole_obj, #clone, convert_item, #delete, #do_update, #each_complex, #get_property_handler, #in_cell?, #initialize, #method_missing, #move, #move_ole, #move_x, #move_y, #ole_cell, ole_object?, #property_handler, #read_ole, #redraw, #update, #updated?, #write_ole

Methods included from ElementTrait

#autocad_type, #block_reference?, #bounds, #cell?, #def, #drawing, #explode, #graphical?, #has_tags?, #highlight, #id_from_record, #inspect, #line?, #model, #parent, #pviewport?, #select, #text?, #to_ole, #visible?

Constructor Details

This class inherits a constructor from Autocad::Element

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Autocad::Element

Instance Method Details

#coordinatesObject

Array of all vertex coordinates in the polyline



150
151
152
# File 'lib/autocad/line.rb', line 150

def coordinates
  @ole_obj.coordinates.map { |pt| Point3d.new(pt) }
end

#lengthObject

The total length of all polyline segments



144
145
146
# File 'lib/autocad/line.rb', line 144

def length
  Point3d.new @ole_obj.Length
end