Importer install dir Mac

I’m using the slapi to make an importer plugin. I used to install it in the PlugIns folder inside the SketchUp package, but with the latest versions of Mac OSX if I do that, when I start SketchUp a dialog pops up saying that the application is corrupted and can’t start. Apparently in the latest version of OSX they increased security.
Am I still supposed to install the importer plugins in that directory? Is there a workaround?
Thanks,

Nicola

PS. The problem appears only in SketchUp 2015

Since SketchUp 2014, Plugins go in the User path’s Library “Plugins” directory.

(1) Open SketchUp.
(2) Window (menu) > Ruby Console (menu item)
(3) Type into the console and hit ENTER:

Sketchup::find_support_file("Plugins")

On Windows (6+) it returns:

"%SYSTEMDRIVE%/Users/%USERNAME%/AppData/Roaming/SketchUp/SketchUp 2015/SketchUp/Plugins"

or more generally:

"%APPDATA%/SketchUp/SketchUp 2015/SketchUp/Plugins"

ADD: On the Mac it is likley this (or similar):

"~/Library/Application Support/SketchUp/SketchUp 2015/SketchUp/Plugins"

Also … if you put the plugin into a Zip archive, and rename the file extension from .zip to .rbz, then the “Install Extension” button, on the “Extensions” panel, of the “Preferences” dialog, will install it into the correct location for your customers. (No need to explain any complicated technicalities of how to unhide the appdata folders, etc.)

As an .rbz archive, it can also be installed by the Trimble Extension Warehouse, or the SketchUcation Plugin Store extension.

hey dan,

@fluidinteractv is talking about importer plugins (the ones which generally have .plugin extensions instead of .rb)

these ones:

i don’t know whether or not these will work in the regular plugins folder but just pointing out that fluid is talking about import/export plugins that show up in the list at File->Export

In OS X 10.9.5 and OS X 10.10, Apple has changed their code-signing requirements. This is a bit of a guess, but you may need to sign your plugin before OS X will allow SketchUp to load it.

Jeff, thanks for clarifying.

The funny think is that there appears to be some check on the integrity of the SketchUp package, even if you just delete one of the default importer plugins shipped with SketchUp, you won’t be able to open SketchUp anymore.

So I suspect that new importer plugins should be installed somewhere else.
Installing the .plugin file to the ~/Library/Application Support/SketchUp/SketchUp 2015/SketchUp/Plugins directory doesn’t work, I’m gonna try zipping it and changing to the rbz extension, but I suspect that is not the correct location for importer plugins.

Ok, I can confirm that the extension mechanism works for importer plugins as well. Just zip the .plugin file and then rename the extension from .zip to .rbz

Cool. Where did the “mechanism” end up putting the files, just for giggles ?

On PC, these files are DLLs, and the OEM ones are in the “Exporters” and “Importers” sub-directories.
There is a SketchUp RubyAPI Importer wrapper class that helps interface with SketchUp.

Ruby’s global require() method can load binaries as well as rb scripts.

So (theoretically,) an importer plughin could be wrapped in a SketchupExtension instance, that allowed the user to switch it on and off.

In Mac, it puts them in ~/Library/Application Support/SketchUp/SketchUp 2015/SketchUp/Plugins
and works fine.

But in Windows it doesn’t seem to work. I’m gonna try to use a ruby script to load the binary dll as you suggested.

For a DLL, the entry point function must be a concat of the DLL filename (exact case) + “_Init”, otherwise require() will spit out a LoadError.

Interesting. I have a similar thing I’m trying to figure out in another thread about building a custom exporter using the Xcode example in the SDK which generates a XmlExporter.plugin file.

zipping that resulting file, renaming it to XmlExporter.plugin.rbz or XmlExporter.rbz, neither end up with it showing up on the File->Export menu for 3D.

Any suggestions? Is your Importer written in C or Ruby?

I wrote my importer in Ruby.

I used the Ruby API method Sketchup.register_importer(), to make SketchUp aware of my importer instance (so it could be listed as a filetype in the import file dialog’s filetype dropdown list.)

What? Did you think you got your own special standalone listing in the File menu (or Import submenu )?

I do not think that is the case, unless you yourself create the menuitem, and program the Export file dialog yourself.

The importer I’m writing is in C++ and uses the SLAPI SDK.

@drwave Are you testing it on SketchUp Make or SketchUp Pro? I think SketchUp Make doesn’t load other exporters besides the default ones.

The Ruby method likely calls a C-side function, so there should be a SDK function as well.

I’m doing this is SketchUp Pro 2015. Turns out I had to put it in the Plugins directory of the app bundle, which is unfortunate, but doable.