sketchucation logo sketchucation
    • Login
    ℹ️ GoFundMe | Our friend Gus Robatto needs some help in a challenging time Learn More

    Help with Mac compatibility?

    Scheduled Pinned Locked Moved Developers' Forum
    7 Posts 4 Posters 655 Views
    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.
    • honoluludesktopH Offline
      honoluludesktop
      last edited by

      One of my plugins reports the attached error message, I presume upon loading:

      http://forums.sketchucation.com/download/file.php?id=60578

      Anyone know what kind of difference between a Mac, and PC might account for that error message. Within my code, I have variables like vari="", and statements like hit_point != nil. Could any of those be bad syntax, leading to problems on a Mac?

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

        Look for a String expression, in which the variable might not be yet defined (and therefor a nil object.)

        I'm not here much anymore.

        1 Reply Last reply Reply Quote 0
        • T Offline
          tfdesign
          last edited by

          Just a shot in the dark (and I'm probably completely wrong here), but should the variable be set at -0 or -1 to get it to work? I seem to remember something about Unity having a similar problem when writing javascript to open a door, ie you could get a door to rotate 180 degrees, but the variable needed to make it do so had to start at -1 rather than 0.

          My book "Let's SketchUp!" Download from here

          1 Reply Last reply Reply Quote 0
          • J Offline
            Jim
            last edited by

            Looked at your plugin - you are using a line:

            file_path_name=Sketchup.find_support_file "sketchup.exe", ""

            One cause may be that since Mac's don't use .exe file extensions, the above line returns nil.

            You can use this to find the plugins folder on either platform.

            file_path_name = Sketchup.find_support_file("plugins")

            Hi

            1 Reply Last reply Reply Quote 0
            • honoluludesktopH Offline
              honoluludesktop
              last edited by

              Thanks for all the help everyone. Will help me code better. Jim, you hit the nail on the head. It's exactly what I have done. I'm flattered that you thought to look at my spaghetti coding. Just, when I thought that I was done with updating my code for this year. That line must be in half of the applications I've recently posted.

              1 Reply Last reply Reply Quote 0
              • J Offline
                Jim
                last edited by

                However, using the above does require that a plugin be installed in the Plugins folder. For maximum plugin portability, something similar to the following can be used to tell a plugin that its associated data folder is located relative to plugin file, rather than relative to THE Plugins folder.

                my_dir = File.dirname(File.expand_path(__FILE__))
                my_data_folder = File.join(my_dir, "my_data")
                my_small_image = File.join(my_data_folder, "my_small_image.png")
                

                etc.

                The incorrect assumption is that plugins are always installed in THE plugins folder, when in fact plugins can load from anywhere on a disk, network, or portable device.

                I use a C:\Plugins folder that is used by all the versions of SketchUp I have installed. It's much easier not to have to copy and paste an entire folder of plugins from one version to the next.

                There are a number of plugins that I can not move out of the Plugins folder because they were written under the assumption they would be put in SketchUp Plugins folder.

                Hi

                1 Reply Last reply Reply Quote 0
                • honoluludesktopH Offline
                  honoluludesktop
                  last edited by

                  @jim said:

                  ............
                  I use a C:\Plugins folder that is used by all the versions of SketchUp I have installed. It's much easier not to have to copy and paste an entire folder of plugins from one version to the next............

                  Good idea, even though there are exceptions.

                  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