sketchucation logo sketchucation
    • Login
    Oops, your profile's looking a bit empty! To help us tailor your experience, please fill in key details like your SketchUp version, skill level, operating system, and more. Update and save your info on your profile page today!
    🛣️ Road Profile Builder | Generate roads, curbs and pavements easily Download

    Error loading file

    Scheduled Pinned Locked Moved Developers' Forum
    7 Posts 2 Posters 887 Views 2 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
      confitex architure
      last edited by

      Hello,
      When I try to launch a newly written script, at sketchup startup, I get the following message that means Error loading file...

      @unknownuser said:

      ^Erreur de chargement du fichier insertc.rb
      C:/Program Files/Google/Google SketchUp 6/Plugins/insertc.rb:210: syntax error name = "insertc.rb"

      I see no reason it happens because I've launched it once and at the second launch, it failed.
      Please, I need your help
      Thank you.

      1 Reply Last reply Reply Quote 0
      • TIGT Online
        TIG Moderator
        last edited by

        @unknownuser said:

        Hello,
        When I try to launch a newly written script, at sketchup startup, I get the following message that means Error loading file...

        @unknownuser said:

        ^Erreur de chargement du fichier insertc.rb
        C:/Program Files/Google/Google SketchUp 6/Plugins/insertc.rb:210: syntax error name = "insertc.rb"

        I see no reason it happens because I've launched it once and at the second launch, it failed.
        Please, I need your help
        Thank you.

        What does line 210 of the script say ?

        Perhaps give a few lines either side too - you don't need to give away the whole script if you don't want to...

        TIG

        1 Reply Last reply Reply Quote 0
        • C Offline
          confitex architure
          last edited by

          Hi TIG
          thanks, you're right it would be easier...

          	
          #--------------------------------------------------------
          end		#### END OF CLASS ####
          #--------------------------------------------------------
          
             name = "insertc.rb" #this one is line 210
             unless file_loaded?(name)
                menu = UI.menu("Plugins")
                menu.add_item("insertc") { Sketchup.active_model.select_tool InCompo.new }
                file_loaded(name)
             end
          
          

          I also have these alerts...

          @unknownuser said:

          C:/Program Files/Google/Google SketchUp 6/Plugins/insertc.rb:212: syntax error
          menu = UI.menu("Plugins")
          ^
          C:/Program Files/Google/Google SketchUp 6/Plugins/insertc.rb:213: syntax error
          menu.add_item("insertc") { Sketchup.active_model.select_tool InCompo.new }
          ^
          C:/Program Files/Google/Google SketchUp 6/Plugins/insertc.rb:213: unterminated string meets end of file
          C:/Program Files/Google/Google SketchUp 6/Plugins/insertc.rb:213: syntax error

          1 Reply Last reply Reply Quote 0
          • TIGT Online
            TIG Moderator
            last edited by

               
            end      #### END OF CLASS ####
            #--------------------------------------------------------
            ### Try changing 'name' to something else in case it's clashing with a 'name' variable somewhere else...
               name_of_plugin = "insertc.rb" #this one is line 210
               unless file_loaded?(name_of_plugin)
                  menu = UI.menu("Plugins")
                  menu.add_item("insertc") { Sketchup.active_model.select_tool InCompo.new }
               end
               file_loaded(name_of_plugin)### Move this outside of 'unless' test...
            
            

            TIG

            1 Reply Last reply Reply Quote 0
            • C Offline
              confitex architure
              last edited by

              still got that

              @unknownuser said:

              ^Erreur de chargement du fichier insertc.rb
              C:/Program Files/Google/Google SketchUp 6/Plugins/insertc.rb:210: syntax error
              name_of_plugin = "insertc.rb"
              ^
              C:/Program Files/Google/Google SketchUp 6/Plugins/insertc.rb:212: syntax error
              menu = UI.menu("Plugins")
              ^
              C:/Program Files/Google/Google SketchUp 6/Plugins/insertc.rb:213: syntax error
              menu.add_item("insertc") { Sketchup.active_model.select_tool InCompo.new }
              ^
              C:/Program Files/Google/Google SketchUp 6/Plugins/insertc.rb:213: unterminated string meets end of file
              C:/Program Files/Google/Google SketchUp 6/Plugins/insertc.rb:213: syntax error

              I'm editing my script in notepad++

              I don't see any reason why that happens

              1 Reply Last reply Reply Quote 0
              • C Offline
                confitex architure
                last edited by

                There were something wrong with a previous UI.messagebox, mabey a quote problem, I don't realy realize...

                
                	UI.messagebox "Added Bed"
                end #if
                
                end #Place_Component
                #---------------------------
                	
                	
                #-----------------------------------------------------------------------------------------------
                end		#### END OF CLASS ####
                #-----------------------------------------------------------------------------------------------
                
                

                thanks TIG !!

                1 Reply Last reply Reply Quote 0
                • TIGT Online
                  TIG Moderator
                  last edited by

                  Although the SUp Ruby API doesn't stress it, I think it's safer to put things into () after a method:

                  So UI.messagebox "A message..." becomes UI.messagebox("A message..."), you are then more likely to spot errors like missing quote closing.

                  If you are using Notepad++ (I do too) then set up your Ruby format defaults to say have any strings in red - then if you miss off a closing " everything afterwards is coloured red and stands out as wrong...

                  TIG

                  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