Module: Microstation::Functions
- Included in:
- App
- Defined in:
- lib/microstation/functions.rb
Instance Method Summary collapse
- #clear_ui ⇒ Object
- #get_point ⇒ Object
- #get_points_by_line ⇒ Object
- #get_points_by_rectangle ⇒ Object
Instance Method Details
#clear_ui ⇒ Object
38 39 40 |
# File 'lib/microstation/functions.rb', line 38 def clear_ui cad_input_queue.clear_ui end |
#get_point ⇒ Object
42 43 44 |
# File 'lib/microstation/functions.rb', line 42 def get_point cad_input_queue.get_point end |
#get_points_by_line ⇒ Object
24 25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/microstation/functions.rb', line 24 def get_points_by_line queue = cad_input_queue queue.show_command("Get points by line") start_point = queue.get_point return Failure(:point1_reset) if start_point.failure? queue.send_command "PLACE LINE" queue.send_data_point start_point.value! end_point = queue.get_point("Enter next vertex") return Failure(:point2_reset) if end_point.failure? Success([start_point.value!, end_point.value!]) end |
#get_points_by_rectangle ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/microstation/functions.rb', line 10 def get_points_by_rectangle queue = cad_input_queue queue.show_command("Get points by block") start_point = queue.get_point return Failure(:point1_reset) if start_point.failure? queue.send_command "PLACE BLOCK" queue.send_data_point start_point.value! end_point = queue.get_point return Failure(:point2_reset) if end_point.failure? Success([start_point.value!, end_point.value!]) end |