[Plugin] Components manager plugin
-
Thanks for the update but it appears the same message in Ruby Console:
%(#FF0000)[Error al cargar archivo /Users/Oxer/Library/Application Support/SketchUp 2013/SketchUp/Plugins/BGSketchup/Composants/Rb/Composants_Main.rb
Permission denied - /Users/Oxer\BGSketchup_Composants.ini
Error al cargar archivo BGSketchup_Composants.rb
Permission denied - /Users/Oxer\BGSketchup_Composants.ini] -
@oxer said:
Thanks for the update but it appears the same message in Ruby Console:
%(#FF0000)[Error al cargar archivo /Users/Oxer/Library/Application Support/SketchUp 2013/SketchUp/Plugins/BGSketchup/Composants/Rb/Composants_Main.rb
Permission denied - /Users/Oxer\BGSketchup_Composants.ini
Error al cargar archivo BGSketchup_Composants.rb
Permission denied - /Users/Oxer\BGSketchup_Composants.ini]Hello Oxer,
could you please post the complete error message ? To which line produce this bug ?
thank you ! -
The answer is in the text
/Users/Oxer****\****BGSketchup_Composants.ini
The backslash \ will only work as a file separator character on PCs, NOT MACs !
A / works on both platforms.
You should useFile.join(directorypath, filename)
to avoid this issue.
Also you can use.tr!("\\","/")
to fix it.
[Conversely, on PC if you ever want to pass a path to say a "cmd" use.tr!("/","\\")
as DOS always expects \ !]On PC AND on MAC this will work:
/Users/Oxer****/****BGSketchup_Composants.ini
Change the code from:
file_name=BGSketchup_my_documents_dir()+"\\BGSketchup_Composants.ini"
to
file_name=Fiile.join(BGSketchup_my_documents_dir(), "BGSketchup_Composants.ini")
which avoids the\
...Incidentally don't set def methods with uppercase first letter:
BGSketchup_my_documents_dir()
NO
bgSketchup_my_documents_dir()
YES
Although a method named 'getTempFolder()
' would be more logical*** ??***Writing this ini file to that user-location is also somewhat ill-advised ?
Why not put it into a 'Temp folder' - this varies between PC and MAC...
ENV['TEMP'] || ENV['TMPDIR']
if !(mac) ... return path.strip.gsub("\000","") else #On Mac return File.expand_path "~" end
could simply be:
return ENV['TEMP'] || ENV['TMPDIR']
On PC it gives:
C:\Users\UserName\AppData\Local\Temp
OR perhaps on PC [ruby:3kd2xg63]ENV['APPDATA'][/ruby:3kd2xg63] giving:
[ruby:3kd2xg63]C:\Users\UserName\AppData\Roaming[/ruby:3kd2xg63]
On MAC it's the user's hidden ..../T[emp] folder
Keeping it 'out of the way', and avoiding all of the '.so' rigmarole and odd locations for the .ini file...
-
How TIG says, the answer is in the text, all red text is the Error Message.
Thanks TIG for the explanation, i don't know the ruby code. -
Hello,
Thank you TIG for your help.
Your code is so much simple than mine...I changed to yours.New version (1.9.4) solve only this error.
-
Version 1.9.5 :
Corrected : When saving all definitions, it asks now to save also file without link.
Optimzed : Now, for revision management, file with letter after revision level and accepted "toto rev 3 (super").skp"Oxer, any feedback as a MAC user ?
I will officially post this version tomorrow if no bugs are found.
In parrallel I will look for JQL request but won't post new version (I think too much version make confusion...)
-
-
Now, there isn't Console Error when you open Sketchup, the settings window appears, the plugin generates the BGSketchup_Composants.ini file in Temporal folder, the translation works but the there are some problems:
- The list is empty, when you push Update List button, nothing happens, no error in Ruby Console.
- If you push Reload All Components button, it appears an error in Ruby Console, see the image 2.
- If you push Save All Components button, it appears a first pop up window (image 3), i push Yes button and it appears a second empty pop up window (image 4), i push yes and it appears a Ruby Console Error (image 5).
-
That '
nil
' error points to code at line #494 of the scriptComposants_Main.rb
- which reads:
UI.messagebox @strNbEnregistementDefinitions+" ("+compteur_ok.to_s+"/"+compteur.to_s+")"
So presumably a part of it is actually 'nil
' ?
@strNbEnregistementDefinitions
is set elsewhere in the scriptLocalization.rb
.
This is set from a series of 'if/elsif
' tests, BUT ill-advisedly there is no 'fall-back' 'else
' when nothing matches the other tests - so then it can return 'nil
', and thereby cause the error - because a 'nil
' object can't be used as part of a textstring
!Perhaps change the code to read...
@strNbEnregistementDefinitions='?' unless @strNbEnregistementDefinitions UI.messagebox(@strNbEnregistementDefinitions+" ("+compteur_ok.to_s+"/"+compteur.to_s+")")
OR have a proper '
else
' fall-back in theLocalization.rb
tests section...The other two methods used in compiling the remainder of the string should always safely return a string as they start off as
0
- giving'... (1/2)'
etc... -
@tig said:
This is set from a series of '
if/elsif
' tests, BUT ill-advisedly there is no 'fall-back' 'else
' when nothing matches the other tests - so then it can return 'nil
', and thereby cause the error - because a 'nil
' object can't be used as part of a textstring
!This could be due to a missing tranlsation in string (a string not defined in one language). Therefore, I change the way of working on Localisation.rb :
1-I load all strings in English
2-I load the strings in the wanted language.
This means that if a string is not translated, the string will be defined with English value.The key thing, for me, is to always have strings defined in English, at minimal.
-
@oxer said:
- If you push Reload All Components button, it appears an error in Ruby Console, see the image 2.
Please try version 1.9.6 below, which should solve this issue.
@oxer said:
- The list is empty, when you push Update List button, nothing happens, no error in Ruby Console.
That's strange...maybe a javascript error...let's try with version 1.9.6, it may solve the issue.
-
Ok, i'll test it.
-
The list continues empty
I'll test the other functions -
- Modify file's path -->works
- Save selected component -->works
- Save all components -->works
- Save with new revision level -->works
- Reload selected component -- > doesn't work, when you select the component it appears "Saved file is newer!" message but when i push Reload selected component button nothing happens, see the image below.
-
@oxer said:
The list continues empty
I'll test the other functionsCould be due to the browser I use which is IE.
Please try to open attached file by placing it in plugins folder, in HTML subfolder. And tells me what happen.
It's just a simplifyed list to see any error that your brownser may show.If you see something like a list, try to open directly the treeview.html file.
Please report me any error...because without list...it's just not so useful...
I maybe need an html/javascript specialist...
-
I placed the test.html file in /Users/Oxer/Library/Application Support/SketchUp 2013/SketchUp/Plugins/BGSketchup/Composants/Html/ then I run Sketchup but when I call the plugin, the list is empty again. I have tried open tree.html in Safari browser and it appears a message:
Safari can't open "sip:get_data@charger_tires" because OSX doesn't recognize the address of internet that begin with "skp:".
When i open test.html in Safari the file shows like this:
-
Hello,
Just post new version, with following updates :
1.9.8: Corrected : Delete all debugging messages, now works on MAC ! Thanks to Oxer !1.9.7: Corrected : Some javascript standard respect Added : Show a message to update the list if the wasn't. Added : Option not to start component mangement on SU start up to avoid adding attribute to model or slow down due to Observers 1.9.6: Corrected : For localisation, in cas of error, the English language is chosen, also, english tranlsation always preload in case translation is missing Corrected : Change function in BGSketchup.rb functions into unic name function to avoid problem with other plugins
-
New version update (v 1.10.0) :
Added : Toolbar with icon to show the plugin window
Added : Help file is now in plugin sub folders, with a link from the "about" window. It was updated with last options explainations
Optimzed : "About" window in HTML format for better rendering and to allow links to help file and forum.
Optimzed : Component list shows scrollbar only is required.
Optimzed : On MAC, use plugin window is now always on top.
Corrected : Only one instance of the window can be shown.
Corrected : Added, some missing translations in Spanish language. -
Hello,
Some updates today !
JQL, one of your request is complete (filters) !
1.11.0:
Added : New option to show list without a tree-style
Added : New button and window to filter item shown on list in case of non tree-style list
Corrected : Component with relative path were shown as "not updated", now shown in grey
Corrected : Tiny bug when showing components without dates
Corrected : Add filter in remove observer to avoid errors
Corrected : When clicking on component in model, all instances were selected if option Auto-select component in model was chosen
Optimzed : Purge only the definitions reloaded, to avoid any trouble with other definition1.10.0:
Added : Toolbar with icon to show the plugin window
Added : Help file is now in plugin sub folders, with a link from the "about" window. It was updated with last options explainations
Optimzed : "About" window in HTML format for better rendering and to allow links to help file and forum.
Optimzed : Component list shows scrollbar only is required.
Optimzed : On MAC, use plugin window is now always on top.
Corrected : Only one instance of the window can be shown.
Corrected : Added, some missing translations in Spanish language.I hope lots of you feel this plugins useful...
3D printer progress...only 1 euro by now... -
Thanks for the update!!
Some questions in OSX:
1. If you select Yes in "Show list in tree-style" Option it doesn't appear like tree-style but if you select No then it appears the list in tree-style, is it the option upside down?
2. In Filters window the option "Component has no defined date" has a blue color but in Component Manager window it appears in black, is it an error?PS. The tooltips in Component Manager window don't translate to Spanish.
EDIT: I had not understood the functionality, it works correctly but if you push Filter button when you have selected YES in option "Show list in tree-style", it appears a pop-up window with this message "You must choose option Show list in tree-style.", I think that it should say --> "You must choose NO in option Show list in tree-style." because with YES it isn't appear the Filters window.
Advertisement