SketchUcation Plugin Store

 

 

How to debug?

Re: How to debug?

Postby Jim » Tue Aug 23, 2011 10:11 pm

end if!
Jim
Global Moderator
 
Posts: 4126
Joined: Mon Nov 12, 2007 10:13 pm
Location: NEOH
Name: Jim
Operating system: Windows
SketchUp version: 8
License type: Pro
SketchUp use: other
Level of SketchUp: Intermediate

Re: How to debug?

Postby Dan Rathbun » Tue Aug 23, 2011 10:29 pm

tomot wrote:
Dan Rathbun wrote:
    line 7: no argument for the instance method DefinitionsList.add()

    No that's not it ! ..... nice try!..... try again?

    Wow... that's strange! An empty argument creates a new definition, whose name is "Component". The API does not mention this!!!

    And Jim.. got it correct... although I would think Ruby would issue a ScriptError, something like "blah blah blah...`end' expected"
    User avatar
    Dan Rathbun
    Top SketchUcator
     
    Posts: 4074
    Joined: Tue Oct 06, 2009 3:06 am
    Location: Florida, USA
    Name: Dan Rathbun
    Operating system: Windows
    SketchUp version: 8
    License type: Pro
    SketchUp use: education
    Level of SketchUp: Advanced

    Re: How to debug?

    Postby tomot » Tue Aug 23, 2011 10:49 pm

    yup! Jim is right!. So back to the initial subject, is there a debug routine for such errors?
    your editor should be causing a high pitch sound for end if or at least a blicking, or bouncing simile. :bounce:
    tomot
     
    Posts: 613
    Joined: Mon Apr 07, 2008 12:18 am
    Operating system: Windows
    SketchUp version: 8
    License type: Free
    SketchUp use: architecture
    Level of SketchUp: Advanced

    Re: How to debug?

    Postby Jim » Tue Aug 23, 2011 11:02 pm

    I was going to suggest checking the syntax, but you would need to have Ruby version 1.8.6 installed (not a bad idea if you are developing plugins.)

    $ ruby -c plugin.rb
    plugin.rb:32: syntax error, unexpected $end
    Jim
    Global Moderator
     
    Posts: 4126
    Joined: Mon Nov 12, 2007 10:13 pm
    Location: NEOH
    Name: Jim
    Operating system: Windows
    SketchUp version: 8
    License type: Pro
    SketchUp use: other
    Level of SketchUp: Intermediate

    Re: How to debug?

    Postby tomot » Wed Aug 24, 2011 12:16 am

    Jim wrote:I was going to suggest checking the syntax, but you would need to have Ruby version 1.8.6 installed (not a bad idea if you are developing plugins.)

    $ ruby -c plugin.rb
    plugin.rb:32: syntax error, unexpected $end


    Jim: you have helped me with a few rubies I have posted here in the past,
    would you please elaborate on I would install Ruby version 1.8.6 within the current Ruby/SU environment.
    Currently I simply use NotePad ++ or SciTE to edit and develop my SketchUp Rubies.
    tomot
     
    Posts: 613
    Joined: Mon Apr 07, 2008 12:18 am
    Operating system: Windows
    SketchUp version: 8
    License type: Free
    SketchUp use: architecture
    Level of SketchUp: Advanced

    Re: How to debug?

    Postby Dan Rathbun » Wed Aug 24, 2011 12:30 am

    User avatar
    Dan Rathbun
    Top SketchUcator
     
    Posts: 4074
    Joined: Tue Oct 06, 2009 3:06 am
    Location: Florida, USA
    Name: Dan Rathbun
    Operating system: Windows
    SketchUp version: 8
    License type: Pro
    SketchUp use: education
    Level of SketchUp: Advanced

    Re: How to debug?

    Postby tomot » Wed Aug 24, 2011 12:33 am

    Dan Rathbun wrote:
    tomot wrote:
    Dan Rathbun wrote:
      line 7: no argument for the instance method DefinitionsList.add()

      No that's not it ! ..... nice try!..... try again?

      Wow... that's strange! An empty argument creates a new definition, whose name is "Component". The API does not mention this!!!

      And Jim.. got it correct... although I would think Ruby would issue a ScriptError, something like "blah blah blah...`end' expected"

      Dan, FYI, I have used that particular code several times to space entities between 2 know points, equally. I don't recall who helped me with the original code, many years ago.
      tomot
       
      Posts: 613
      Joined: Mon Apr 07, 2008 12:18 am
      Operating system: Windows
      SketchUp version: 8
      License type: Free
      SketchUp use: architecture
      Level of SketchUp: Advanced

      Re: How to debug?

      Postby tomot » Wed Aug 24, 2011 4:25 pm

      Jim wrote:Ruby Toolbar started - on Windows, it can open/close the Ruby Console, Clear it, and load/reload a file.


      Jim: I get the following error when starting SU
      Please, register (free) to access all the attachments on the forums.
      tomot
       
      Posts: 613
      Joined: Mon Apr 07, 2008 12:18 am
      Operating system: Windows
      SketchUp version: 8
      License type: Free
      SketchUp use: architecture
      Level of SketchUp: Advanced

      Re: How to debug?

      Postby Dan Rathbun » Wed Aug 24, 2011 5:26 pm

      You need WIn32API.so

      v186_p287_so.zip
      Please, register (free) to access all the attachments on the forums.
      User avatar
      Dan Rathbun
      Top SketchUcator
       
      Posts: 4074
      Joined: Tue Oct 06, 2009 3:06 am
      Location: Florida, USA
      Name: Dan Rathbun
      Operating system: Windows
      SketchUp version: 8
      License type: Pro
      SketchUp use: education
      Level of SketchUp: Advanced

      Re: How to debug?

      Postby brian_concannon » Thu Dec 22, 2011 6:40 am

      I have written a debugger for Sketchup plugins with watches and breakpoints. Why isn't such a debugger already available? Would it be a good contribution to the community? The breakpoints based on watched variable changes seem like the best part.

      Download the user guide that I attached.

      It needs some work yet, as it processes only the Ruby snytax that I have
      programmed with myself. It is a VB6 app. It would be free.

      Quote message
      Face2Face plugin - autoextrusion between faces
      Sent: Wed Dec 21, 2011 4:58 pm
      by brian_concannon

      TIG,

      I posted the plugin as you suggested, in the Resources/Plugins forum. It is being downloaded like crazy!

      I hope you make it part of your Edgedraw plugins somehow.

      anyway, I have written a debugger for Sketchup plugins with watches and breakpoints. Why isn't such a debugger already available? Would it be a good contribution to the community?


      Quote message
      Re: Face2Face plugin - autoextrusion between faces
      Sent: Wed Dec 21, 2011 5:16 pm
      From: TIG
      To: brian_concannon

      It would probably be a useful adjunct.
      Why not post in the Developers' forum with a new thread.
      You don't need to post the whole of your code, just some ideas to get a discussion rolling...
      Thomthom, Jim and Dan are more in debugging etc than I am. I manually slog through with my own return nils, breaks, testing puts, UI.messageboxe, refreshes etc till I get it to work
      Please, register (free) to access all the attachments on the forums.
      brian_concannon
       
      Posts: 6
      Joined: Sat Oct 15, 2011 1:16 pm
      Location: Evansville, Indiana, USA
      Name: Brian Concannon

      Re: How to debug?

      Postby thomthom » Thu Dec 22, 2011 9:39 am

      brian_concannon wrote:I manually slog through with my own return nils, breaks, testing puts, UI.messageboxe, refreshes etc till I get it to work


      That's my method of debugging as well. A debugger would be welcome. There is one out there already SuRDebug: http://code.google.com/p/surdebug/wiki/SuRDebug

      I never got around to fully make it work... :(
      Thomas Thomassen — SketchUp Monkey & Coding addict
      List of my plugins and link to the CookieWare fund
      User avatar
      thomthom
      Global Moderator
       
      Posts: 17603
      Joined: Tue Nov 13, 2007 12:47 pm
      Location: Trondheim, Norway
      Name: thomthom
      Operating system: Windows
      SketchUp version: 8
      License type: Pro
      SketchUp use: architecture
      Level of SketchUp: Advanced

      Re: How to debug?

      Postby brian_concannon » Thu Dec 22, 2011 2:14 pm

      I tried SurDebug early on and could not make it work either. I was told that the author got angry about some criticism, and he stopped working on it. There were no recent posts about it at the site that you show.

      Debuggifier's concept is not as nice as the SurDebug concept, as it inserts debug statements after every Ruby statement in all or part of the code. It can be commented / uncommented at will, and totally removed ("undebuggified") when the Plugin development is complete. But I found it necessary to develop for my own programming, because Ruby is so hard to program with. Anyone using a true IDE knows this.

      I will clean up Debuggifier a little and then post it. Since it is an EXE and requires VB6 DLL's to be installed with InstallShield etc, can I upload it to this forum? Can I upload a zip file?
      brian_concannon
       
      Posts: 6
      Joined: Sat Oct 15, 2011 1:16 pm
      Location: Evansville, Indiana, USA
      Name: Brian Concannon

      Re: How to debug?

      Postby Rich O Brien » Thu Dec 22, 2011 2:19 pm

      There's a 4mb limit and it'll will need to be .zip
      :::Blog:::

      I'm a Trimbler now!
      User avatar
      Rich O Brien
      Administrator
       
      Posts: 8289
      Joined: Fri Oct 31, 2008 9:05 am
      Location: Limerick, Ireland
      Name: Rich O'Brien
      Operating system: Windows
      SketchUp version: 8
      License type: Pro
      SketchUp use: engineering and mechanical design
      Level of SketchUp: Advanced

      Re: How to debug?

      Postby Chiefwoodworker » Wed Jun 20, 2012 1:42 pm

      thomthom wrote:And under Windows you have this snippet to output the data to debuggers like DebugView:
      viewtopic.php?f=180&t=31216&p=274668#p274467

      A friend of mine showed me how to interface Unit Test (http://ruby-doc.org/stdlib-1.9.3/libdoc ... /Unit.html) to the SketchUp API and the Ruby Console. It works really great for certain classes of scripts or methods and it allows you to develop a suite of tests that you can run automatically.

      If anyone is interested I can add instructions to this forum.
      User avatar
      Chiefwoodworker
       
      Posts: 130
      Joined: Fri Feb 08, 2008 4:22 pm
      Location: 325 West Street, Worthington, MA 01098
      Name: Chiefwoodworker
      Operating system: Windows
      SketchUp version: 8
      License type: Pro
      SketchUp use: woodworking
      Level of SketchUp: Advanced

      Re: How to debug?

      Postby thomthom » Wed Jun 20, 2012 1:46 pm

      Chiefwoodworker wrote:If anyone is interested I can add instructions to this forum.

      :thumb: :thumb:
      Thomas Thomassen — SketchUp Monkey & Coding addict
      List of my plugins and link to the CookieWare fund
      User avatar
      thomthom
      Global Moderator
       
      Posts: 17603
      Joined: Tue Nov 13, 2007 12:47 pm
      Location: Trondheim, Norway
      Name: thomthom
      Operating system: Windows
      SketchUp version: 8
      License type: Pro
      SketchUp use: architecture
      Level of SketchUp: Advanced

      Re: How to debug?

      Postby liquid98 » Sun Jul 01, 2012 6:58 pm

      [encourage] :thumb: [/encourage]
      Things that flourish fall into decay. This is not-Tao, And what is not-Tao soon ends ~ Lao tse
      User avatar
      liquid98
       
      Posts: 122
      Joined: Sat Feb 14, 2009 10:42 pm
      Location: The Netherlands
      Name: liquid98

      SketchUcation One-Liner Adverts

      by Ad Machine » 5 minutes ago

      Need SketchUp Books, Models, Styles or Textures? Check out our One Stop Shop for SketchUp.

      Premium Members get 20% discount!

      Ad Machine
      Robot
       
      Posts: 2012

      Previous

      Return to Developers' Forum

      Who is online

      Users browsing this forum: pingdou215 and 6 guests