Few Quick Question for Tool
-
Hello, this is obviously my first post, I hope I am in the right forumn....because I hesitate to call myself a developer, but I am building a tool.
Context: For my Honours thesis I am building a plugin for sketchup that walks community members through a urban design methodology. I would be happy to give more information if anyone is interested.
my background comes from GeoWeb programming, so I'm no pro at Ruby, Although I did just read through all of "Automatic Sketchup, Creating 3-D Models in ruby" (huge props to Matthew Scarpino for writing it).
I just had a few questions I to clear up right now, but I will not doubt be back with more:
-
I am debating on how to best approach my GUI, as it is a key part of my tool. It will need to have a lot of descriptions/text as well as collect deal with a lot of input from the users. Is the UI class enough to handle this....should I move to the more robust Web Dialog? Currently I am leaning towards web dialogs.
-
Sorry if this one is a stupid question but: How would you recommend saving the variables that keep track of the various inputs my users put in if they want to re-open Sketchup. I can store variable information with attributes for entities...but if i wanted to say have arrays that hold different community visions for the model, I don't think I can assign attributes to the model can I? perhaps some sort of empty entity I dump information into.
-
is there a reason they added:
Added in SketchUp 8.0+:
addBuilding:
getPhotoTexture:
selectImageIglooTool:
selectNorthTool:to the send_action method but didn't include the new "add_location" tool button? I was hoping to bring this up for the users so they wouldn't have to search down the button.
Thanks all for now~
Cheers
Korbin
-
-
-
I have found webdialogs far more useful than the standard UI options. Post questions here when you get into it. Passing information back and forth has its challenges.
-
You can do Model.set_attribute, and you are allowed to save arrays of data. See this thread: http://forums.sketchucation.com/viewtopic.php?f=180&t=30066 for information about what types of data are allowed in set_attribute. I've found that set_attribute is by far the best way to save data between sessions. This way the data is saved even if the file name is changed, the file is moved, or the file is edited by a user that does not have your plugin.
-
No Clue. I'm sure someone else will have an answer for this.
Good luck!
--
Karen -
-
@kdasilva said:
- is there a reason they added:
... to thesend_action
method but didn't include the new "add_location" tool button? I was hoping to bring this up for the users so they wouldn't have to search down the button.
Korbin, (welcome..) "add_location" is not actually new, the tooltip for the button changed to better describe the function as it interacts with the user in the 8+ edition.
If you are only concerned with PC, see my topic on
send_action
:
[Code] Sketchup.send_action() : Arguments toP.S.: click the "Ruby Resorces" link below in my signature line.
- is there a reason they added:
-
@kdasilva said:
2) ... How would you recommend saving the variables that keep track of the various inputs my users put in if they want to re-open Sketchup.
If the variables are specific to a certain model.. then attributes attached to the model.
If they are general to a plugin and will be used with more than one model, then look at Sketchup.read_default and Sketchup.write_default methods. (It's best to convert all data to strings that will be written into the Windows Registry.)
Or you can use a Settings
Hash
convert it to a string with.inspect()
and write it out to a file. An easy way is to use Marshal.dump() and Marshal.load() (but there are versioning issues.) It's not that hard to open aFile
object and use it'swrite()
orputs()
method to send the string to the file. That way you won't have marshaling version isssues, and as you need to open the fileIO
object in both cases, it's not much difference, either way.@kdasilva said:
I can store variable information with attributes for entities...but if i wanted to say have arrays that hold different community visions for the model, I don't think I can assign attributes to the model can I?
Any Entity subclass inherits the attribute methods. And also they are defined for
Sketchup::Model
class.So for instance you can attach attributes to a
Layer
or a (Scene)Page
because they areEntity
subclasses (not just to theDrawingelement
subclasses.)
Advertisement