But seems to be supported by some SDK programming, am I right? I thought you mean a Ruby-only approach.
azuby
But seems to be supported by some SDK programming, am I right? I thought you mean a Ruby-only approach.
azuby
I guess it is not possible because you can't reach the drawing context of Sketchup.
azuby
Moin moin forum,
short: Layers/Materials with i.e. "ä", "ß" in their names, accessing them via Ruby script, creating File with these names. "läiär" is saved as "läiär"
I've parsed the Strings byte by byte and got
"108 195 164 105 195 164 114" where "195 164" is the "ä"
I've also used UI.savepanel and UI.openpanel to get files with the given name from file system - with same result:
"108 195 164 105 195 164 114"
For saving the files I use File.open
I'm working with Win XP pro.
Has anyone an idea how to solve this problem? I think a mapping could be useful, but do not know which sequence I should map "195 164" to.
azuby
The thing with "between" definitively is an error from the filter_extension extension, it is located in the file filter/geom_selection.rb in line 4. Because the programmers used the evaluation technique, the error is hard to track. So I crawled all the "requires" and decoded them. From the filter_extension.rb you can see who has made the script - F. Rodriguez and Didier Bur.
Also have a look on this old (cached) thread
For the housebuilder thing look here.
azuby
Look this line from the error message:
if (n1.between? (n2 - interval), (n2 + interval)) # seems to be more OK, if you put the brackets to other places;
if n1.between?((n2 - interval), (n2 + interval)) # or
if(n1.between?((n2 - interval), (n2 + interval))) # oh no, it's Ruby, you do not need all them
if n1.between?(n2 - interval, n2 + interval) # also should work
azuby
Maybe this will help a bit: Put the following line of code into a file, which will be shown on top of each directory, i.e. '____.rb' (with underlines, right):
Sketchup.send_action "showRubyPanel;"
This will show the Ruby Console when Sketchup starts. I, as a Ruby developer, have seen, that some scripts print out messages to the console and than stop others running. Maybe you will get some ouput, but I can't guarantee, because I do not know, which scripts get loaded first (you have a couple of directories you described).
azuby from Berlin
For me this code works with the additional line. I put it to a .rb file, load Sketchup, try to use Plugins > Cornflakes > Add mild, it is grayed, I open a .skp file and try the same and get my breakfest.
azuby
Maybe because you have to set the @active_model before using the code - like this:
@active_model = Sketchup.active_model
I haven't ried the code and at the moment I'm in university and do not have Sketchup installed. I'll care this evening, if it won't work as expected.
azuby
Yes, in the sketchup Ruby API documentation,
http://download.sketchup.com/sketchuphelp/gsu6_ruby/Docs/Ruby-Menu.html#set_validation_proc
But the example is a shame. So have a look on these few lines of code:
grayed_proc = Proc.new { @active_model.path.empty? ? MF_GRAYED ; MF_ENABLED }
azubymenu = UI.menu("Plugins").add_submenu "Cornflakes"
azuby_menu_item = azubymenu.add_item "Add milk" do
UI.messagebox "Adding milk to your cornflakes"
end
azubymenu.set_validation_proc azuby_menu_item, &grayed_proc
# take care for the "&" or write the line;
azubymenu.set_validation_proc azuby_menu_item do
@active_model.path.empty? ? MF_GRAYED ; MF_ENABLED
end
An equal usage is possible for toolbar items.
azuby
Remove/Hide: Not on the running process
Grey=Disable: Depends on the script
azuby
I can't help you in that case, but a "compile" error on Ruby scripts? Should be an "Interpreter error" Try to check the Ruby versions. Type to the Ruby Console:
VERSION # or
RUBY_VERSION
azuby
Softlinks come from Unix/Linux world and because Mac OS X is a kind of BSD, which is a kind of Unix, you can use Softlinks. Read more i.e. here: http://www.wlug.org.nz/SoftLink
azuby
Has anyone tried to use softlinks on Mac for that purpose?
azuby
What's the best way depends on your needs. Some people need the Windows Registry, some people like files (ini, xml). If you want to use files, you have to implement the algorithm on your own or load the third party Ruby modules for these jobs like REXML.
azuby
Possible. You only have to check the normal of the triangles / faces and their neighbours. If the normal is the same, you can put them togehter. It's a bit more difficult if you want to have it more fuzzy.
azuby
I think, with an observer and an own datastructure (maybe a simple nested array) it could be done.
azuby
Oh, you have to differentiate between "collection of tools" and "class of Tools"
The class of Tools is Class, Tools itself is a class. What you mean is the collection of one tool and one more tool -> tools (not Tools). I do mention that, because we are in the Ruby forum and Ruby programmers would come in semantic conflict by the words.
This is, what the spec says: "The Tools class contains methods to manipulate a collection of SketchUp tools." - that means a collection of - hm - circle tool, square tool etc. This classs do provide an add_observer method, so that you can register an object to a collection of tools, which gets notified of changes in the collection.
Your are right, there does not seem to be a way of registering an observer to a Tool object. Also subclassing the circle tool does not seem possible, because I can't reach the circle Tool object.
Maybe there is a way adding a Tools observer to the tools collection where the circle tool is in.
azuby
Isn't is possible to observer the Circle Tool itself? Or subclassing the Circle Tool?
azuby
OK folks,
this is a new screenshot. I know, there are two "undefined", which are the result of hand-editing the history file - it's old stuff. Anything you can see on this tab is working. The other tabs ... well ... I have to care. The Tasks tab is OK, you can see all tasks ordered and add new to the current model.
I've removed some bad bugs and added some other functions, for instance a menu entry to get the window back on place where you can see it and with size, which fits to your monitor resolution.
The black bar you can see is a one I hover with the mouse. And something more to colors: I use the system colors, so if your menu items are dark red, you will have dark red elements in that UI.
azuby