HTMLDialog vs WebDialog?
-
@medeek said:
The error codes posted above.
... are occurring (according to your error messages,) in "
medeek_roof_truss.rbs
", line 5726, in callback methodonLButtonDown
.In the first you are calling a
*()
method upon an object that is referencing the global singletonnil
object. Since theNilClass
does not have an "asterisk" method, aNoMethodError
is raised.The second method is caused by your code expecting a
Float
object, but getting aString
object instead.The answer is simple. Whenever an object reference could reference disparate types (classes) of obejcts, use a combination of type validation and Ruby
rescue
clauses with theonLButtonDown
callback method. -
Okay 95% of that just went over my head, but I'll try and decipher into terms I can understand.
But why would this error only be raised for SketchUp running on MacOS and not Windows?
-
Basically I'm trying to prompt you to learn how to read Ruby error and backtrace messages.
āfilename:lineNo: in
methodāā or āfilename:lineNo.ā`http://ruby-doc.org/core-2.2.4/doc/syntax/exceptions_rdoc.html
http://ruby-doc.org/core-2.2.4/Exception.html@medeek said:
Okay 95% of that just went over my head, but I'll try and decipher into terms I can understand.
An example in Ruby of testing if an object reference is pointing at an object of a certain class:
if obj.is_a?(NilClass)
... or ...
if obj.is_a?(Float)
An example in Ruby of validating that an object reference call responds to a certain method call:
if obj.respond_to?(:methname)
... and testing for the "asterisk" method specifically:
if obj.respond_to?(:*)
@medeek said:
But why would this error only be raised for SketchUp running on MacOS and not Windows?
I don't know (offhand) as I avoid Macs myself. (But OSX and MS Windows use different sets of keycodes.)
Actually, looking at the backtraces (in your original error listing) the errors are kicked off by a LButtonDown keypress, but are occurring in the `` create_timber_geometry()`' method, lines 1064 and 1355.
Advertisement