sketchucation logo sketchucation
    • Login
    ℹ️ Licensed Extensions | FredoBatch, ElevationProfile, FredoSketch, LayOps, MatSim and Pic2Shape will require license from Sept 1st More Info

    HELP setting up a SU code editor

    Scheduled Pinned Locked Moved Developers' Forum
    97 Posts 11 Posters 6.4k Views 11 Watching
    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
      driven
      last edited by

      @dan rathbun said:

      Wht re-invent? Ruby has a debugger.Not, a all, I 'm meaning some sort of version control/monitor/indicator, so if I write what I think is a really simple beginners type ruby, with only SU6 on a Mac available for testing, my editor can highlight the fact I've used a Win32 only method that also needs MeshAdditions.rb + Geodesic.rb or wharever... before it will run on my machine

      It's part of the stabdard library. It makes more since to get it working woth SU embedded Ruby.

      %(#004000)[**I totally agree on that, problem is some Standard things appear not to work on All machines, Before we even get into properly evaluating things like GPU and CPU it would be good to know if something is Never going to work

      It could also mean, that if I want to distribute a RadRails Ruby9 experimental plugin that I've concocted on my bespoke setup, I can forewarn others who might want to use it, or supply the extra bits as an instal package**]

      learn from the mistakes of others, you may not live long enough to make them all yourself...

      1 Reply Last reply Reply Quote 0
      • Dan RathbunD Offline
        Dan Rathbun
        last edited by

        @driven said:

        @dan rathbun said:

        Why re-invent? Ruby has a debugger.
        Not, a all, I 'm meaning some sort of version control / monitor / indicator, so if I write what I think is a really simple beginners type ruby, with only SU6 on a Mac available for testing, my editor can highlight the fact I've used a Win32 only method that also needs MeshAdditions.rb + Geodesic.rb or wharever... before it will run on my machine.

        Oh OK, well then debugger is the wrong term for what you want. And we've discussed something similar before in other threads, Rick Wilson had an experimental approach that was implemented as embedded documentation, that would need to be parsed. I think they were 'leaning' toward a RDoc-like syntax.

        Myself, and I think Jim Foltz prefer something that is 'live-Ruby.' Where a ruby script, (or a module distro'd with Sketchup,) tasked with Extension management, can actually ask the plugin / extension about itself.

        Right now, if you have ever used the SketchupExtension class, you should realize that it creates a Ruby object (before an extension / script is actually loaded and only loads it if the user has 'checked the box' in the Extensions page of the Preferences dialog. The SketchupExtension class object contains (at present,) only a handful of attributes, but if you compare them to those within a GEM spec ... you should find the the GEM spec has an attribute for almost all those in the SketchupExtension object; plus quite a few more.

        I would prefer either adopting the GEM spec format, or as close to it as possible; and revise the SketchupExtension class (rev 2?, which should really be Sketchup::Extension class,) to add extra attributes, stealing those from GEM spec that apply, and adding some specific Sketchup attributes (such as a platform attribute: 'PC','Mac' or 'Both') It should be possible to add attributes to the class, and still be backward compatible, ie, the current SU Extensions dialog will just ignore all the extra attributes.

        Looking forward.. a future SU version could 'grey-out' the checkbox if the extension does not support the user's platform, or if the user's installation does not have modules or classes that are listed in the 'dependancies' attribute(s). This could work for 'conflicts', where the checkbox does not become active until conflicting extensions have been unchecked.

        So, then.. an editor / IDE could also access this information. If Sketchup is loaded, the IDE could iterate and query the Extensions collection to determine what it needs to know. If SU is not loaded, the IDE could start it's own Ruby instance, and run a script that can build it's own SU Extensions collection.

        I'm not here much anymore.

        1 Reply Last reply Reply Quote 0
        • M Offline
          MartinRinehart
          last edited by

          @driven said:

          I hadn't grasped that your, "hey guys, no need to look under the hood" API was devised to slow peoples own programing knowledge.

          I invite you to take a quick look at my table of contents. Chapter 15 covers programming with the Transformation class methods. Chapter 16 covers the "no transformation matrix" programming. 16 also includes a critique of the "no transformation matrix" programming, explaining where it is not enough.

          Appendix T covers the matrix in depth for those who want to get under the covers of the Transformation class. Appendix MM explains matrix multiplication.

          This is all "devised to slow peoples own programming knowledge"?

          Author, Edges to Rubies - The Complete SketchUp Tutorial at http://www.MartinRinehart.com/models/tutorial.

          1 Reply Last reply Reply Quote 0
          • D Offline
            driven
            last edited by

            Martin, cross posting, so I'll respond to you first. As a fan of your 'work', I do NOT think that 'slowing people down' is your intentions, however, I get pissed off when I feel I'm being asked to stay away from something because I'm not 'professional', please read on

            Dan, and everyone else following or stumbling in

            I should have apoligised in advance for offending people, I'm bound to, it's in my nature.

            sorry about my terminology errors, I'm not a coder, scripter, etc..
            but, what I'm good at is finding loopholes, backdoors, fast-tracks into systems, workflows, tecnogogies I have NO business even looking into(in some peoples opinion)

            I have spent most my working life as a Special (physical) Effects designer attempting to cobble together all sorts of concepts and devices into a singular coherent manageable solutions and teaching others how to do the same. (Course Director-BSc(Hons) Special Effects Design LSBU)[note: course closure attributed to the rising demand for Visual Effects (3D cg)]

            This is all I'm trying to do now, I want one 'bespoke' SU ruby that will achieve my particular set of tasks and I can see no reason why my concept shouldn't work on my mac running SU.

            After, an initial search I discovered there isn't a Developers pack in the same way there is for Mac, iPhone, Safari, WedKit, etc. or even a program like ControllerMate aimed at SU on any platform.

            This, more than anything, surprises me.

            What I did find was SCF and an odd international assortment of like-minded (mostly)individuals pursuing a common aim of making SU better for all by sharing and amalgamating resources.

            I feel (currently) it is a 'cause' I can be comfortable participating in, adding my unconventional problem solving mentality to the mix.

            I'm not particularly good at using SU, or understanding code but I'm improving, and I am happy to take advice follow links, share findings, etc... as are a core group of this forum's users.

            Enough 'blog', back ON SUBJECT, I've downloaded, Apanta for PC to run under Parallel's and when looking for a VM instal tutorial I came across this http://bitnami.org/forums/forums/rubystack-jrubystack/topics/howto-windows-rubystack-aptana-radrails-ruby-debug
            I'll follow there advice to see what happens, but would appreciate opinions.

            john

            Back OFF SUBJECT-
            I can surf, login, upload and download at 3D ware house on Parallel's XP SU (I don't get a bugsplat till shut-down), so it's not my hardware or ruby version stopping me from signing in and uploading when I try from Mac/SU on the same computer?

            learn from the mistakes of others, you may not live long enough to make them all yourself...

            1 Reply Last reply Reply Quote 0
            • thomthomT Offline
              thomthom
              last edited by

              @driven said:

              It could also mean, that if I want to distribute a RadRails Ruby9 experimental plugin that I've concocted on my bespoke setup, I can forewarn others who might want to use it, or supply the extra bits as an instal package[/b]

              Are you trying to write SU plugins with Ruby on Rail?
              (I'm feeling I'm not entirely on track with this thread any more...)

              Thomas Thomassen — SketchUp Monkey & Coding addict
              List of my plugins and link to the CookieWare fund

              1 Reply Last reply Reply Quote 0
              • Dan RathbunD Offline
                Dan Rathbun
                last edited by

                @thomthom said:

                Are you trying to write SU plugins with Ruby on Rails?

                It's only one of John's ideas he's playing with. No harm in playing. Specifically I think he's thinking of it as perhaps a WebDialog/WebApplet platform.

                If such a 'plugin' ran from a remote website or network server, I can see that it may have merit.

                I have reservations however if Rails were to be used as a local WebDialog platform, as it's a server technology, and each client would need to have a full Ruby install along with RubyGems and Rails. That raises install headaches on the PC side. (Personally, I am nervous having servers run on my client machine, with an always on, broadband internet connection.)

                I'd be interested to see if we could get eruby running under SUruby as a WebDialog helper.

                I'm not here much anymore.

                1 Reply Last reply Reply Quote 0
                • D Offline
                  driven
                  last edited by

                  @thomthom said:

                  Are you trying to write SU plugins with Ruby on Rail?

                  Maybe, if i have to,
                  I'm looking at 'Rails' more as a source of cross-platform 'ruby' tools that may be re-purposed into a 'cross-platform' Sketchup Plugins Tools that cope with 'all' you might find/use not just the 'ruby' (and also for the db, doc handling abilities.)

                  As Dan points out, why re-invent the wheel. If it can be de-'railed' which 'may' just involve setting the preferences right, then it's a fast route to having a bespoke SU editor.

                  If you look at this lifted text and re-reference as if aimed at Sketchup, I think you'll agree it would be nice...
                  %(#008080)[About BitNami

                  What is BitNami?

                  The aim of BitNami is to simplify the deployment of web applications, such as wikis or blogs, in order to make them more accessible. There are a lot of high quality open source software packages that aren’t used as much as they could be because getting them up and running can be a complex process. We want to change that!

                  What are BitNami Stacks?

                  A BitNami Stack is an integrated software bundle that includes a web application and all of its required components (web server, database, language runtime), so it is ready to run out of the box. The Stacks can be deployed as traditional Native Installers, Virtual Machine Images or Cloud Images. Native installers are single file executables that you download to your machine. When double-clicked, they walk you through each step of the automated installation process. They are available for Windows, Mac OS X, Linux and Solaris. BitNami Virtual Machine Images are pre-configured and include a minimal installation of Linux and a BitNami Stack. They are available for VMWare and the latest version of VirtualBox. BitNami Cloud Images allow you to run a BitNami Stack in a cloud computing environment on a pay-as-you-go basis, and programmatically start and stop them. BitNami Cloud Images are currently available for Amazon EC2, with planned support for additional cloud environments.

                  Regardless of whether you choose a Native Installer, Virtual Machine Image or Cloud Image, you will be able to have your BitNami-packaged application of choice up and running in just minutes, with no manual configuration required.]
                  @thomthom said:

                  (I'm feeling I'm not entirely on track with this thread any more...)

                  Me as well, we need to get back on rail(s)

                  john

                  learn from the mistakes of others, you may not live long enough to make them all yourself...

                  1 Reply Last reply Reply Quote 0
                  • D Offline
                    driven
                    last edited by

                    @dan rathbun said:

                    If such a 'plugin' ran from a remote website or network server, I can see that it may have merit.
                    I have reservations however if Rails were to be used as a local WebDialog platform,

                    [Although not using Rails] isn't this what Google do when you install the 'Gears' plugin for o3d Dev or Apple with the iPhone or iPad Dev kits?

                    @Thomas... The other, diversion on this thread is me trying to clarify the 'Baseline' and while it is touched on in other threads, those seem to be wanting to know for different reasons. i.e end user script management, etc...

                    I want to run a SetUpSketchUpTest.rb that proves what does and doesn't work, on any given setup, as opposed to second guessing and/or collating historic, disparate threads here and elsewhere.

                    If packaged as a simple one off 'Platform Tolerant' installation on volunteers machines the information could be fed into an editors library and let you know, as you type, if potential problems are there....

                    learn from the mistakes of others, you may not live long enough to make them all yourself...

                    1 Reply Last reply Reply Quote 0
                    • thomthomT Offline
                      thomthom
                      last edited by

                      Ok - I'm getting more back on track now.

                      Thomas Thomassen — SketchUp Monkey & Coding addict
                      List of my plugins and link to the CookieWare fund

                      1 Reply Last reply Reply Quote 0
                      • Dan RathbunD Offline
                        Dan Rathbun
                        last edited by

                        @driven said:

                        @dan rathbun said:

                        Nor does: class Sketchup::Geodesic [show on PC]
                        only if you don't have Geodesic.rb instaled BEFORE loading suapi.rb

                        @dan rathbun said:

                        I cant find (mix-in) module Smoothable (is this a plugin?)
                        also, only if you don't have Geodesic.rb instaled BEFORE loading suapi.rb
                        Again, is Geodesic a Google plugin, or a third-party plugin?

                        @driven said:

                        @dan rathbun said:

                        None of the DC classes or modules are on your list.
                        I don't have Pro installed
                        It doesn't matter, the DC classes are needed even on Free to interact with Dynamic Components. On the PC, if you turn OFF the DC extension, most of the Attribute Dictionary class methods no longer work.
                        The reason they are not enumerated / cataloged by su_api.rb is, that the script specifically ONLY targets modules Sketchup, UI and Geom. (I don't know this was by design, or honest omission.)

                        @driven said:

                        @dan rathbun said:

                        The following classes, don't have prototypes defined (BUT SHOULD!):
                        UI::InputPoint [*no-proto]
                        REVISED**
                        UI::Menu [*no-proto]REVISED
                        UI::PickHelper [no-proto]REVISED
                        UI::Tool [no-proto]

                        why??? Not sure what you mean here, but it may come to me if they suddenly turn up
                        REVISED:
                        InputPoint is defined as:Sketchup::InputPoint
                        Menu is defined as:Sketchup::Menu
                        PickHelper is defined as:Sketchup::PickHelper
                        (..and they ARE on your list.)
                        The confusion comes because the API doc lists them under "UI Classes".
                        The Tool class is weird. There is no prototype for coders to subclass, and this is often confusing for newbies. Sketchup treats an object as a tool, when the object is passed as the arg to Model.select_tool.

                        @driven said:

                        @dan rathbun said:

                        *Sketchup::FrameChangeObserver [no-proto]
                        Is this a Pro thing?
                        No, it's general. The sample in the Sketchup Blog shows how to use it with Dynamic Components (but it likely can be used for other things.)
                        The weird thing is, it doesn't really matter what this class is named, when you attach an instance of this observer class, Sketchup only cares that it have a callback method named 'frameChange'.
                        But not having a 'prototype' of the class (for coders to subclass,) will mean that it will never show up in the API docs. Also, the Blog example, adds in a PC bug workaround. If this workaround was written into a proto-class then any custom subclass would inherit the 'fix'.
                        The example is named 'scenes.rb' you can download a nice formatted copy at:
                        http://www.smustard.com/forum/viewtopic.php?f=9&t=25#p47
                        and the Blogpost can be read here:
                        http://sketchupapi.blogspot.com/2009/07/dynamic-components-that-react-to-scene.html

                        @driven said:

                        @dan rathbun said:

                        And then the standard extensions:
                        LanguageHandler ( should be moved to -> UI::LanguageHandler )
                        SketchupExtension (should be moved to -> Sketchup::Extension )

                        possibly Mac thing, but are you see the pattern emerging?
                        This occurs because su_api.rb specifically does not look for these classes, so they don't get enumerated / cataloged.

                        @driven said:

                        I know there other factors, but we can test against installed version of Ruby as well as other...
                        Just a reminder that Win32/PC platform does not come with Ruby installed. There are users who would not understand how to install (or more so maintain,) a full Ruby installation. I'm thinking about a scenario where a PC (perhaps even a Mac,) can have a 'normal' full Ruby install in the normal place; AND a second full install under the Sketchup directory that is 'tweaked' specifically for use with Sketchup (and in the future hopefully Layout.)
                        That way the normal install can stay normal, and be used for things like Rails, without affecting SU. The opposite would be true as well. I've already manually copied a full 1.8.6 install into my SU folder. (This way I can have a 1.9.1 install in the root of my system, that is separate, as Sketchup can't handle v1.9.x at this time.)

                        I'm not here much anymore.

                        1 Reply Last reply Reply Quote 0
                        • Dan RathbunD Offline
                          Dan Rathbun
                          last edited by

                          @driven said:

                          Basically, it seems suapi.rb could be the basis for a de-bugger..

                          Why re-invent? Ruby has a debugger. It's part of the standard library. It makes more sense to get it working with SU embedded Ruby.

                          I'm not here much anymore.

                          1 Reply Last reply Reply Quote 0
                          • Dan RathbunD Offline
                            Dan Rathbun
                            last edited by

                            @driven said:

                            so what does this mean?

                            It means I made a boo-boo (slappin' 'self up side the head!) 😳

                            It's defined? SKSocket

                            I'm not here much anymore.

                            1 Reply Last reply Reply Quote 0
                            • D Offline
                              driven
                              last edited by

                              %(#FF0000)[defined SKSocket?
                              Error: #<NoMethodError: (eval):894: undefined method `SKSocket?' for main:Object>
                              (eval):894]

                              %(#008000)[defined? SJSocket
                              nil
                              SKSocket.methods(false).sort.join("\n")
                              add_socket_listener
                              connect
                              disconnect
                              write]

                              so what does this mean?

                              learn from the mistakes of others, you may not live long enough to make them all yourself...

                              1 Reply Last reply Reply Quote 0
                              • Dan RathbunD Offline
                                Dan Rathbun
                                last edited by

                                @driven said:

                                SKSocket doesn't show up under XP....

                                I can see it on my PC. At the console type:
                                ` defined? SKSocket

                                constantIf it were not defined the %(#BF0000)[defined?] keyword would return %(#BF0000)[nil]. SKSocket.methods(false).sort.join("\n")

                                outputs:

                                add_socket_listener
                                connect
                                disconnect
                                write`

                                EDIT: fixed typo: 'defined? SKSocket' was 'defined SKSocket?'

                                I'm not here much anymore.

                                1 Reply Last reply Reply Quote 0
                                • D Offline
                                  driven
                                  last edited by

                                  Dan, trial and error got me there, anyway...
                                  thanks for the detailed explanation above, I had figured most of that out and was turning things 'on' and adding to the su_api.rb when I got distracted by being able to upload to 3D Warehouse from XP I'm trying to run a port scan to see how it differs between SUXP and SUMac upload path, I suspect a clash, but SU crashes if I come out of it to turn on my scanner, do you happen to know the PC routing to 3D Warehouse from SU?

                                  learn from the mistakes of others, you may not live long enough to make them all yourself...

                                  1 Reply Last reply Reply Quote 0
                                  • Chris FullmerC Offline
                                    Chris Fullmer
                                    last edited by

                                    So in the end is it possible to hook up a debugger to SU? Pecan seemed to get something working, but his project seemed unstable on many systems. So iis possible, or not really. This painful thread is 5 pages long and its gone off on to so many tangents, I just can't take the suspense any more. Debugger possible? 👍 👎

                                    Lately you've been tan, suspicious for the winter.
                                    All my Plugins I've written

                                    1 Reply Last reply Reply Quote 0
                                    • Chris FullmerC Offline
                                      Chris Fullmer
                                      last edited by

                                      So I thought I should post a link to Pecan's previous work. so I started digging around only to find that nearly all traces of it have been removed from the forum at his request I think. I think it worked on his system but caused so many problems for other people that he did not want to troublshoot it anymore.

                                      But I did find a link to the wiki where he was updating everything. This might be itneresting to some of you guys. It seems to me like maybe you are talking about some of the same stuff that he was was trying to do to.

                                      500 Server Error

                                      favicon

                                      (code.google.com)

                                      See if that is helpful in any way.

                                      Lately you've been tan, suspicious for the winter.
                                      All my Plugins I've written

                                      1 Reply Last reply Reply Quote 0
                                      • D Offline
                                        driven
                                        last edited by

                                        @chris fullmer said:

                                        See if that is helpful in any way.

                                        Chris, that's incredibly helpful, I have tried all those search terms in various combinations and never come across this before... thanks for pointing it out.

                                        and yes a SU 'ruby' de-bugger is possible it's just not easy and cross platform, a little trickier still... and a multi language SU debug is a real 'bugger'

                                        john

                                        learn from the mistakes of others, you may not live long enough to make them all yourself...

                                        1 Reply Last reply Reply Quote 0
                                        • D Offline
                                          driven
                                          last edited by

                                          @dan rathbun said:

                                          Again, is Geodesic a Google plugin, or a third-party plugin?

                                          Sorry Dan I do keep forgetting to add this

                                          ` #--

                                          *** This code is copyright 2004 by Gavin Kistner

                                          *** It is covered under the license viewable at http://phrogz.net/JS/_ReuseLicense.txt

                                          *** Reuse or modification is free provided you abide by the terms of that license.

                                          *** (Including the first two lines above in your source code usually satisfies the conditions.)

                                          #++

                                          Author:: Gavin Kistner (mailto:!@phrogz.net)

                                          Copyright:: Copyright (c)2004 Gavin Kistner

                                          License:: See http://Phrogz.net/JS/_ReuseLicense.txt for details

                                          Version:: 1.3, 2004-Oct-3

                                          Full Code:: link:../Geodesic_SketchUp.rb

                                          This file allows the user to add geodesic models to SketchUp (http://www.sketchup.com).

                                          See the Sketchup::Geodesic.create method for more information on creating and adding a geodesic dome/sphere.

                                          ====Version History

                                          20040916 v1.0 Initial release; relies on Geodesic.rb

                                          20040920 v1.1 Rewrite to use only SketchUp classes

                                          20040920 v1.1.1 Fixed it to actually load 😉

                                          20040920 v1.2.1 Added icosahedron option. Spruce up documentation.

                                          20041003 v1.3 Added primitive picker to the dialog interface. (Thanks TBD!)

                                          The Sketchup::Geodesic class cannot be instantiated; it is a wrapper for the Sketchup::Geodesic.create method. See that method for more details.

                                          class Sketchup::Geodesic`

                                          learn from the mistakes of others, you may not live long enough to make them all yourself...

                                          1 Reply Last reply Reply Quote 0
                                          • D Offline
                                            driven
                                            last edited by

                                            @unknownuser said:

                                            definitely separate, SU only uses one processor so you really want to be on the other...
                                            [quote="Dan Rathbun":1k2r0bq3][
                                            Hmmm.. things are getting better when things become cross-plaform.

                                            I agree, although separate OS builds of common components and libraries isn't a big issue, especially if use RubyStacks or similar to output your SU versions.

                                            Don't suppose you have ever watched the You Tube videos on 'MacFuse'?the last 10 minutes + Q&A of the long one are interesting, [it all is if you use mac....] http://code.google.com/p/macfuse/

                                            learn from the mistakes of others, you may not live long enough to make them all yourself...

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

                                            Advertisement