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

    Localhost in webdialog - bridge to everywhere?

    Scheduled Pinned Locked Moved Developers' Forum
    8 Posts 3 Posters 768 Views 3 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.
    • chrisglasierC Offline
      chrisglasier
      last edited by chrisglasier

      I have to say I got pretty disillusioned with webdialogs. I thought I would try a different route by first making a web machine to automate and reuse information and then look for a way to generate 3D models. In doing so I belated discovered localhost (with Apache and PHP). All my stuff is based on generating instructions from plain text (json) records; these instructions link to script devices (the simplest to produce listings). The localhost easily copes with reading and writing files, works with any browser and most importantly does not have to have Sketchup present.

      Just today I wondered what would happen if I opened the localhost in a webdialog. Surprisingly (to me) the localhost worked just as before. I closed Sketchup and added a link in the localhost to a .skp file in the same directory. Clicking on the link launched Sketchup and opened the file. I also added a simple skp:callback which worked OK once I had opened the webdialog from the plugins menus.

      It would be good if when the file is opened it could also open the webdialog. The file is really just a space to lay out components so it does not have to be saved. There are questions about having two instances of the localhost on screen and what happens when Sketchup is closed (can a Ruby launch the standalone localhost?)

      I guess there are many if and buts but I very much like the idea of having a universal interface that can call up Sketchup as a kind of plugin and then transform iself into a plug in to Sketchup. So I think it is worth pursuing.

      edit: 'adjusted' subject may 12 2011

      With TBA interfaces we can analyse what is to be achieved so that IT can help with automation to achieve it.

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

        What's exactly the question?

        http://localhost/ is just an alias for http://127.0.0.1/ - when WAMP/LAMP/*AMP is installed it makes localhost act just the same as any other website...

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

        1 Reply Last reply Reply Quote 0
        • chrisglasierC Offline
          chrisglasier
          last edited by

          @thomthom said:

          What's exactly the question?

          http://localhost/ is just an alias for http://127.0.0.1/ - when WAMP/LAMP/*AMP is installed it makes localhost act just the same as any other website...

          My point is that if you use localhost rather than a local file (file.html) you can work outside SU locally (and via a server I guess) and then plug SU in as and when required. I didn't ask any direct question but was rather hoping for some discussion of the points in the penultimate para:-

          @unknownuser said:

          It would be good if when the file is opened it could also open the webdialog. The file is really just a space to lay out components so it does not have to be saved. There are questions about having two instances of the localhost on screen and what happens when Sketchup is closed (can a Ruby launch the standalone localhost?)

          With TBA interfaces we can analyse what is to be achieved so that IT can help with automation to achieve it.

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

            hi Chris,

            hope your well, local host is great on the mac.
            You can run it in custom webveiws that have can more local privileges than WebDialog.

            I've played round with it using node.js and chrome V8 serving json into SU.

            The other avenue for your stuff is to combine 'local hosted' webdialogs with html5 local and session storage.

            I've been trying to get sceneMachineMac to store a Template skp that opens 'selected' from my model in a new 'temporary' drawing for setting up an export animation.

            I know there are SU ruby ways of achieving what I'm doing but they can bog down on large models so this is an attempt to move some of the load to other processes on my system. It seems promising

            BTW. how the website going?

            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
            • thomthomT Offline
              thomthom
              last edited by

              @chrisglasier said:

              My point is that if you use localhost rather than a local file (file.html) you can work outside SU locally (and via a server I guess) and then plug SU in as and when required. I didn't ask any direct question but was rather hoping for some discussion of the points in the penultimate para:-

              @unknownuser said:

              It would be good if when the file is opened it could also open the webdialog. The file is really just a space to lay out components so it does not have to be saved. There are questions about having two instances of the localhost on screen and what happens when Sketchup is closed (can a Ruby launch the standalone localhost?)

              Open standalone localhost - open the URL in a normal web browser? UI.open_url http://code.google.com/apis/sketchup/docs/ourdoc/ui.html#openURL

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

              1 Reply Last reply Reply Quote 0
              • chrisglasierC Offline
                chrisglasier
                last edited by

                @driven said:

                ...

                BTW. how the website going?

                john

                Hopefully there will be more thoughts tomorrow.

                I totally stripped out the website just to demonstrate the mechanised words (mechonyms) as an alternative to paperwork metaphors.

                With TBA interfaces we can analyse what is to be achieved so that IT can help with automation to achieve it.

                1 Reply Last reply Reply Quote 0
                • chrisglasierC Offline
                  chrisglasier
                  last edited by

                  @thomthom said:

                  Open standalone localhost - open the URL in a normal web browser? UI.open_url http://code.google.com/apis/sketchup/docs/ourdoc/ui.html#openURL

                  That's great thanks

                  With TBA interfaces we can analyse what is to be achieved so that IT can help with automation to achieve it.

                  1 Reply Last reply Reply Quote 0
                  • chrisglasierC Offline
                    chrisglasier
                    last edited by

                    Now I have got to the stage where I can pop my freestanding php file into a web dialog but so I can run Sketchup either via my localhost or website I need to have a ruby version of this php:

                    
                    class IP{
                    	public function Iptrue() {
                    		if ($_SERVER['REMOTE_ADDR'] == "127.0.0.1"){
                    			echo true;
                    		}
                    	}
                    }	
                    
                    

                    Can this be done with Sketchup ruby API?

                    Thanks

                    Thanks

                    With TBA interfaces we can analyse what is to be achieved so that IT can help with automation to achieve it.

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

                    Advertisement