Plugins Locations
-
@al hart said:
So we are now thinking about installing our App in Program Files instead of the SketchUp Plugins folder, and only using a couple of .rb files in the plugins folder to find the rest of the app.
If it is not "data" used by an application, or it is an executable, it should be in the %ProgramFiles% path. Or if it supports multiple versions of SketchUp.
Your app, say RenderPlus, can have it's own AppData folder, with SketchUp verison subfolders, for the users data.
-
@al hart said:
What are your thoughts and/or what have you learned already?
I learned to ALWAYS read the Release Notes.
Your a developer, so reference:
http://www.sketchup.com/intl/en/developer/docs/releases.php
.. and take note of the section for SketchUp 2014, viz:(razzin' ya')
BUT... you have found a booboo.
find_support_files
should really not return pathnames from a "Plugins" directory, in the binary ("Program Files",) path under SketchUp 2014+.IMO, it should return a warning or exception instead, if the user creates a "Plugins" folder there.
-
@al hart said:
We are looking for a work-around for users with Unicode Characters in their user names - which causes \Users\XXX\AppData to fail with: "Error: #<Encoding::CompatibilityError: incompatible character encodings: Windows-1252 and UTF-8>"
Can you give some more background for this error? Are you creating a string from ENV or FILE for the filename you want to load?
-
@tt_su said:
Can you give some more background for this error? Are you creating a string from ENV or FILE for the filename you want to load?
To duplicate a problem we are having with a client, I created a user on my machine with an extended ASCII character in the name (using a word from a path in the users AppData location).
The user name is: aplikacíX (but there is a hex 0xa1 in front of the X. (Here is a hex dump)
C:\AA>echo aplikacíX| od -hc
0000000 7061 696c 616b a163 0d58 000a
a p l i k a c 241 X \r \nI then used find_support_file() to get the complete path of a file name in Plugins:
sdll = Sketchup.find_support_file('Plugins/RPS_win32_IRender_nXt.so')
sdll was set to: C:/Users/aplikacíX/AppData/Roaming/SketchUp/SketchUp 2014/SketchUp/Plugins/RPS_win32_IRender_nXt.so
I then passed the name on to require
require sdll
and I get this error:
Error: #<Encoding::CompatibilityError: incompatible character encodings: Windows-1252 and UTF-8>
C:/Program Files (x86)/SketchUp/SketchUp 2014/Tools/RubyStdLib/rubygems/core_ext/kernel_require.rb:109:inend_with?' C:/Program Files (x86)/SketchUp/SketchUp 2014/Tools/RubyStdLib/rubygems/core_ext/kernel_require.rb:109:in
rescue in require'
C:/Program Files (x86)/SketchUp/SketchUp 2014/Tools/RubyStdLib/rubygems/core_ext/kernel_require.rb:35:in `require'It is possible that the error is with a call in the .so file. I'll try to find a way to check that out.
-
Ah! yes, the loading binary libraries issue. We have a fix for that coming up.
-
@dan rathbun said:
This IS expected... a user can copy a shared plugin to THEIR OWN plugin folder, and tweak it for their own use. THEIR edition then loads for THEM only, without affecting the edition that is shared by other users.
That was pretty clever! - Letting the User have his own version and it works well for APPDATA and ProgramData.
But if the same rubies happen to be in a SketchUp 2014 Plugins folder in Program Files, then find_support_file() finds them instead. (I understand that no one is supposed to place anything in the SketchUp Plugins folder in Program Files - but you can imagine why users using SketchUp 2014 for the first time might copy their old Plugins folder into SketchUp 2014 in Program files)
I placed identical ruby files - one in Plugins and one in a sub-folder of Plugins - in APPDATA and in ProgramData - and the AppData ones got run properly. (Using find_support_file() to get the full path of the second file worked properly)
However, when I placed the same files in Program Files as well (the same rubies in all 3 locations), and used get_support_file() to try to find the second ruby file, then it messed up and found the one in Program Files. When SketchUp started up, it ran the first ruby file from APPDATA, but find_support_file found the one in Program Files instead of the one in APPDATA.
I created two ruby files, rps_level1.rb uses find_support_file() to locate rps_level2.rb and then runs it.
rps_level1.rb - placed in Plugins:
` SKETCHUP_CONSOLE.show
printf("\n-----------------------\n")
printf("IN: %s\n", FILE)printf("\nIN: 'RPS/rps_level2.rb'\n")
$sfull_path = Sketchup.find_support_file('Plugins/RPS/rps_level2.rb').to_s
printf("\nLOADING FULL PATH: %s\n", $sfull_path)
load ($sfull_path)`
rps_level2.rb placed in the Plugins/RPS sub folder:
printf("IN rps_level2.rb: %s\n", __FILE__)
When duplicate files were placed in APPDATA and ProgramData only the ones in APPDATA were executed:
` -----------------------
IN: C:/Users/Al/AppData/Roaming/SketchUp/SketchUp 2014/SketchUp/Plugins/rps_level1.rbLOADING FULL PATH: C:/Users/Al/AppData/Roaming/SketchUp/SketchUp 2014/SketchUp/Plugins/RPS/rps_level2.rb
IN rps_level2.rb: C:/Users/Al/AppData/Roaming/SketchUp/SketchUp 2014/SketchUp/Plugins/RPS/rps_level2.rb`But when I placed a third copy in Program Files Plugins, find_support_file found the one in Program Files and ran it instead.
(Sketchup.find_support_file() called from APPDATA returned the path in Program Files.)
` -----------------------
IN: C:/Users/Al/AppData/Roaming/SketchUp/SketchUp 2014/SketchUp/Plugins/rps_level1.rbLOADING FULL PATH: C:/Program Files (x86)/SketchUp/SketchUp 2014/Plugins/RPS/rps_level2.rb
IN rps_level2.rb: C:/Program Files (x86)/SketchUp/SketchUp 2014/Plugins/RPS/rps_level2.rb` -
Hi,
I am a newbee in sketchup plugin development and I am facing an issue with sketchup 2014.
My plugin dll is not geeting loaded in su2014,which used to get loaded without any errors till su2013.I am getting the following error messages
Error Loading File sketchupConnector
Could not find included file 'sketchupConnector'
Error Loading File C:/Users/damayantib/AppData/Roaming/SketchUp/SketchUp 2014/SketchUp/Plugins/eDrawings/edpublisher.rb
Error: #<NoMethodError: undefined methodcheck_license' for Sketchup::EDrawingsTools:Module> C:/Users/damayantib/AppData/Roaming/SketchUp/SketchUp 2014/SketchUp/Plugins/eDrawings/edpublisher.rb:583:in
module:EDrawingsTools'
C:/Users/damayantib/AppData/Roaming/SketchUp/SketchUp 2014/SketchUp/Plugins/eDrawings/edpublisher.rb:5:in<top (required)>' C:/Program Files (x86)/SketchUp/SketchUp 2014/Tools/extensions.rb:197:in
require'
C:/Program Files (x86)/SketchUp/SketchUp 2014/Tools/extensions.rb:197:in `load'Can anyone help me with this issue!!!
Thanks in advance.
-
SketchUp changed from Ruby 1.8 to Ruby 2.0 in version 2014. So you need to make sure all binaries are compatible with the updated Ruby interpreter.
-
I have tried that too.I have changed the thirdparty from ruby1.8 to ruby2.0 and built my project in vs2010, but the error persists.
-
Hmm... the error actually complains about a file not found...
Could not find included file 'sketchupConnector'
And an undefined method...
Hard to tell without knowing anything about the extension. But I'd trace down the missing method and file.
Have you tried the Ruby Debugger - letting you step through Ruby code?
https://github.com/SketchUp/sketchup-ruby-debugger -
Hi,
I have created a sample extension .This is my Samplemenus.rb file.
I am not getting the message box when I click on 'publish'.Am I missing something here.
I guess the syntax is wrong somewhere. plz help.require 'sketchup.rb'
module Sketchup::Sampletoolif defined?(Sketchup::Set)
Set = Sketchup::Set
endPLUGIN = self
def pop_message
UI.messagebox('Hit')
end
#------------------------------------------------------------------------------Add things to the Utilities menu
if( not $edrawings_menu_loaded )
sample_menu = UI.menu("Plugins").add_submenu("sample")
sample_menu.add_item("Publish") {pop_message }
$edrawings_menu_loaded = true
end -
Try using:
**self.**pop_message
instead...BUT please don't mess with the 'Sketchup' module - make your own module e.g. 'SWAPB'
Also don't use unnecessary global-variables like$edrawings_menu_loaded
, they can be replaced in this instance with something like...unless file_loaded?(__FILE__) ... file_loaded(__FILE__) end
Why do you need to redefine
Set
?Also this is NOT an 'Extension', it some simple Ruby plugin code to add a menu item and make a messagebox etc...
Also learn to put your post's code inside [code] or [
ruby
] blocks... like my snippets above... -
.. and the nested module definition has no
end
closure.
Advertisement