Method: Autocad::Drawing#get_float

Defined in:
lib/autocad/drawing.rb

#get_float(prompt: "Enter a float") ⇒ Float

Get a floating point input from the user

Examples:

Get a scale factor

scale = drawing.get_float(prompt: "Enter scale factor:")

Parameters:

  • prompt (String) (defaults to: "Enter a float")

    The string to prompt the user

Returns:

  • (Float)

    User input

Raises:



771
772
773
774
775
# File 'lib/autocad/drawing.rb', line 771

def get_float(prompt: "Enter a float")
  utility.GetReal(prompt)
rescue => ex
  raise Autocad::Error.new("Error getting float input from user #{ex}")
end