Class: LineCreation
- Inherits:
-
Object
- Object
- LineCreation
- Includes:
- PrimitiveCommandInterface
- Defined in:
- lib/microstation/primitive_command_interface.rb
Instance Attribute Summary collapse
-
#points ⇒ Object
readonly
Returns the value of attribute points.
Instance Method Summary collapse
- #DataPoint(pt, _view) ⇒ Object
- #Dynamics(pt, _view, _drawmode) ⇒ Object
-
#initialize(app) ⇒ LineCreation
constructor
A new instance of LineCreation.
- #Reset ⇒ Object
- #Start ⇒ Object
Methods included from PrimitiveCommandInterface
Constructor Details
#initialize(app) ⇒ LineCreation
Returns a new instance of LineCreation.
26 27 28 29 |
# File 'lib/microstation/primitive_command_interface.rb', line 26 def initialize(app) @app = app @points = Array.new(2) end |
Instance Attribute Details
#points ⇒ Object (readonly)
Returns the value of attribute points.
24 25 26 |
# File 'lib/microstation/primitive_command_interface.rb', line 24 def points @points end |
Instance Method Details
#DataPoint(pt, _view) ⇒ Object
31 32 33 34 35 36 37 38 39 40 41 42 |
# File 'lib/microstation/primitive_command_interface.rb', line 31 def DataPoint(pt, _view) case points.compact.size when 0 app.ole_obj.CommandState.StartDynamics @points[0] = pt app.show_prompt "Place end point" when 1 @points[1] = pt line_from_pts(@points) @points[0] = @points[1] end end |
#Dynamics(pt, _view, _drawmode) ⇒ Object
44 45 46 47 48 49 |
# File 'lib/microstation/primitive_command_interface.rb', line 44 def Dynamics(pt, _view, _drawmode) return unless @points.compact.size == 1 @points[1] = pt line = line_from_pts(@points) end |
#Reset ⇒ Object
51 52 53 54 |
# File 'lib/microstation/primitive_command_interface.rb', line 51 def Reset app.CommandState.StartPrimitive self @points = Array.new(2) end |
#Start ⇒ Object
56 57 58 59 |
# File 'lib/microstation/primitive_command_interface.rb', line 56 def Start app.show_command "VBA PlaceLine Example" app.show_prompt "Select start of line" end |