• Login
sketchucation logo sketchucation
  • Login
πŸ€‘ SketchPlus 1.3 | 44 Tools for $15 until June 20th Buy Now

Instructor content

Scheduled Pinned Locked Moved Developers' Forum
84 Posts 8 Posters 7.9k Views 8 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.
  • C Offline
    Chris Fullmer
    last edited by 21 Sept 2010, 21:28

    Hey, I'm trying to add some simple content to the instructor. And so far its not working and SU is not returning any errors to hint at what I'm doing wrong.

    I have a tool class. And I have defined the Tool.getInstructorContentDirectory method and it returns (I think) the correct path:

    def getInstructorContentDirectory return "C:\\Temp" end

    Inside the folder that it returns resides an html file index.html and a swf file that is embedded in the index file. If I open the html file in a browser, the video plays. So that appears to be working.

    But when I activte my tool in SU, it does not show my instructor content. It just stays on the current content page.

    Any thoughts? My first guess is that it is returning the path incorrectly. Files/paths and I have never quite gotten along in the ruby world. 😳

    Thanks,

    Chris

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

    1 Reply Last reply Reply Quote 0
    • K Offline
      Krisidious
      last edited by 21 Sept 2010, 21:30

      nice to see you're working on this... hope someone can help sort it out.

      By: Kristoff Rand
      Home DesignerUnique House Plans

      1 Reply Last reply Reply Quote 0
      • D Offline
        Dan Rathbun
        last edited by 21 Sept 2010, 22:27

        Could it be a Vista security issue not wanting to allow access to the Temp folder?

        Did you try a "test" html page, that has no active content. Such as containing only text "My Tool Help Page" or similar?
        This could verify that SU is finding the folder, and loading the index.html file.

        If that works.. then the issue may be with the tag used for the video.
        Is it a <APPLET> or <OBJECT> tag?

        I'm not here much anymore.

        1 Reply Last reply Reply Quote 0
        • C Offline
          Chris Fullmer
          last edited by 21 Sept 2010, 23:03

          I went ahead and moved the index.html to the root c:\ folder. Changed the return path in the method. I removed the embed tags from the html and just put the word "Hi" in it. No luck. It did not appear to attempt to load my instructor file.

          Next I'll try to make a more simple tool. the one I am trying it out on is a very big file. For all I know I've messed up something somewhere else in the tool that is preventing the instructor content from loading. I'll let you know how a simpler tool works out.

          Chris

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

          1 Reply Last reply Reply Quote 0
          • C Offline
            Chris Fullmer
            last edited by 21 Sept 2010, 23:16

            ok, I tried new tool from scratch. This is the complete script:

            ` class Clf_instructor
            def getInstructorContentDirectory
            UI.messagebox "working"
            "c:\"
            end
            end

            if !file_loaded?(FILE) then
            UI.menu("Plugins").add_item("Instructor Tester") { Sketchup.active_model.select_tool Clf_instructor.new }
            end`

            It is calling the instructorcontent method for sure. It just is not displaying the index.html file. I wonder if there is a bug logged for this? or I'm probably just overlooking something simple (like my path might not be right, or my html might be unnacceptable?)

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

            1 Reply Last reply Reply Quote 0
            • C Offline
              Chris Fullmer
              last edited by 21 Sept 2010, 23:20

              I just supplied it with the path to the instructor content for the tape measure tool:

              "C:\\Program Files\\Google\\Google SketchUp 7\\Resources\\en-US\\helpcontent\\tool\\21024\\"

              But it did not work. So it appears it is not my html, it is something else.

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

              1 Reply Last reply Reply Quote 0
              • D Offline
                Dan Rathbun
                last edited by 22 Sept 2010, 05:11

                Chris.. Ruby does not like backslashes. You can convert backslashed paths to Ruby paths using File.expand_path(path_arg)

                And.. since you'd normally want to be cross-platform, you need to use forward slashed paths for OSX anyway.

                I'm not here much anymore.

                1 Reply Last reply Reply Quote 0
                • T Offline
                  thomthom
                  last edited by 22 Sept 2010, 06:39

                  In SU6 the instructor window goes blank - but I can also not get any content in the Instructor in any versions.

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

                  1 Reply Last reply Reply Quote 0
                  • D Offline
                    Dan Rathbun
                    last edited by 22 Sept 2010, 09:48

                    I had no luck either.

                    I even tried to match the tool_id to the folder name, and had the helpfolder in the helpcontent folder where all the other tool helps are. No luck.

                    I even tried to fully specify the path with "/index.html" on the end. No luck.

                    So it's bug. There goes another couple of my uitility ideas, down the drain.

                    I'm not here much anymore.

                    1 Reply Last reply Reply Quote 0
                    • T Offline
                      thomthom
                      last edited by 22 Sept 2010, 09:53

                      It appear to have been broken for a long time.

                      Has no one ever made a tool with an Instructor?

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

                      1 Reply Last reply Reply Quote 0
                      • D Offline
                        Dan Rathbun
                        last edited by 22 Sept 2010, 10:05

                        @thomthom said:

                        Has no one ever made a tool with an Instructor?

                        I have never tried it, but had some ideas I wanted to use the instructor because it's "snappy" and has the small toolwindow caption bar.

                        So it's either webdialog or native Win32 dialog (I'm leaning toward the latter... if Google is not going to bring the Mac Ruby up to date.. then screw it.. sorry Apple lovers.)

                        I'm not here much anymore.

                        1 Reply Last reply Reply Quote 0
                        • T Offline
                          thomthom
                          last edited by 22 Sept 2010, 12:53

                          @dan rathbun said:

                          So it's either webdialog or native Win32 dialog (I'm leaning toward the latter... if Google is not going to bring the Mac Ruby up to date.. then screw it.. sorry Apple lovers.)

                          What does the rube core got to do with the webdialog?

                          I had been thinking of adding an Instructor for a couple of tools - but it'd not been high on the list. I was about to add it to Vertex Tools - but due to the way I made the sub-tool system I could not. (should be way to force refresh the instructor window with other content.)

                          @dan rathbun said:

                          I have never tried it, but had some ideas I wanted to use the instructor because it's "snappy" and has the small toolwindow caption bar.

                          How would you use it? You can't use it to communicate back to Ruby... 😞

                          I've been playing with the idea of using Win32API to change the window style of the webdialogs. But I'm not sure if I can manage it without getting a flicker of the original window frame first...

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

                          1 Reply Last reply Reply Quote 0
                          • TIGT Offline
                            TIG Moderator
                            last edited by 22 Sept 2010, 14:17

                            I have already written an 'Instructor' set of index.html/css/gif files etc for my new FreeRotate4.1 [not yet released] BUT it simply doesn't work... no matter what I do πŸ˜’
                            At the moment it only works if you open the ../FreeRotate/index.html file in your web-browser...
                            The Instructor never recognizes the tool as being active/current...
                            I was thinking that perhaps you need to add a global_variable - setting it in the activate() and resume() methods, e.g.
                            $instructorContentDirectory = self.getInstructorContentDirectory()
                            BUT what that global_variable might be is a mystery... πŸ˜•
                            I there a way to puts a list of global_variables ?
                            If you start FreeRotate whilst in Line tool the Instructor sticks on Line, then if you Orbit it changes to Orbit, until you exit and pick another tool ???
                            I've tried tool_id/pop/push et al with no positive results.
                            It is as if my tool isn't registering as the active/current tool at all...

                            TIG

                            1 Reply Last reply Reply Quote 0
                            • T Offline
                              thomthom
                              last edited by 22 Sept 2010, 14:20

                              Anyone contacted Google yet?

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

                              1 Reply Last reply Reply Quote 0
                              • TIGT Offline
                                TIG Moderator
                                last edited by 22 Sept 2010, 14:23

                                Not me...
                                TT - it's your turn... πŸ˜‰

                                TIG

                                1 Reply Last reply Reply Quote 0
                                • T Offline
                                  thomthom
                                  last edited by 22 Sept 2010, 14:26

                                  I think they still have a backlog on all my issues πŸ˜’ - but I can nag them about this one as well.

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

                                  1 Reply Last reply Reply Quote 0
                                  • B Offline
                                    bentleykfrog
                                    last edited by 6 Mar 2011, 21:19

                                    seems like the response is relative to the help directory on pc 😲

                                    writing the following brings up the eraser tool

                                    def getInstructorContentDirectory
                                      return "\\21019\\"
                                    end
                                    

                                    so looks like relative paths it is

                                    1 Reply Last reply Reply Quote 0
                                    • B Offline
                                      bentleykfrog
                                      last edited by 6 Mar 2011, 21:24

                                      hmmmm the following works well on pc too

                                      def getInstructorContentDirectory
                                        return "../../../../Tools/etc/instructor/"
                                      end
                                      
                                      1 Reply Last reply Reply Quote 0
                                      • C Offline
                                        Chris Fullmer
                                        last edited by 6 Mar 2011, 23:28

                                        Woohoo! That totally does it. that works in 7.1 also, I did not test anything earlier than that. Here is my code that uses it and points to a directory inside the plugins folder:

                                        ` class Clf_instructor

                                        def getInstructorContentDirectory
                                        return "..\..\..\..\Plugins\doc\"
                                        end
                                        end

                                        Sketchup.active_model.select_tool Clf_instructor.new`

                                        (that is just a snippet I was running from the webconsole, not actually part of a full file).

                                        Thanks for coming back and posting that,

                                        Chris

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

                                        1 Reply Last reply Reply Quote 0
                                        • T Offline
                                          thomthom
                                          last edited by 7 Mar 2011, 01:15

                                          The instructor works??? πŸ˜„
                                          Nice find!

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

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

                                          Advertisement