• Login
sketchucation logo sketchucation
  • Login
🤑 SketchPlus 1.3 | 44 Tools for $15 until June 20th Buy Now

HTMLDialog vs WebDialog?

Scheduled Pinned Locked Moved Developers' Forum
23 Posts 5 Posters 4.5k Views
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    Dan Rathbun
    last edited by 17 Sept 2017, 19:29

    @medeek said:

    The error codes posted above.

    ... are occurring (according to your error messages,) in " medeek_roof_truss.rbs", line 5726, in callback method onLButtonDown.

    In the first you are calling a *() method upon an object that is referencing the global singleton nil object. Since the NilClass does not have an "asterisk" method, a NoMethodError is raised.

    The second method is caused by your code expecting a Float object, but getting a String 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 the onLButtonDown callback method.

    I'm not here much anymore.

    1 Reply Last reply Reply Quote 0
    • M Offline
      medeek
      last edited by 17 Sept 2017, 20:28

      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?

      Nathaniel P. Wilkerson PE
      Medeek Engineering Inc
      design.medeek.com

      1 Reply Last reply Reply Quote 0
      • D Offline
        Dan Rathbun
        last edited by 21 Sept 2017, 02:57

        Basically I'm trying to prompt you to learn how to read Ruby error and backtrace messages.
        “filename:lineNo: inmethod”‘ 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.

        Link Preview Image
        Data validation - Wikipedia

        favicon

        (en.wikipedia.org)

        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.

        I'm not here much anymore.

        1 Reply Last reply Reply Quote 0
        • 1
        • 2
        • 2 / 2
        2 / 2
        • First post
          23/23
          Last post
        Buy SketchPlus
        Buy SUbD
        Buy WrapR
        Buy eBook
        Buy Modelur
        Buy Vertex Tools
        Buy SketchCuisine
        Buy FormFonts

        Advertisement