[Question] multi document interface and Tools
-
When a user selects another opened SketchUp document, is still the same tool active or does each model have its own "active" tool?
I would have expected that the same tool stays active, but I'm not sure because the API has
Model.**tools**
instead ofSketchup.tools
. -
I think a PC has independent versions of SUp app for each SKP window, whereas a MAC has multiple windows of one version of the SUp app for a collection of SKP windows; I stand to be corrected.
-
on mac I can have multiple identical environments with independent tool and user preference selections.
Toobars, UI window are either shown in both or hidden in both, but can be selected in just the active one.
john -
Ok, thanks!
Is there a way to keep track of the change of the active document? I didn't find an appropriate AppObserver and I guess this wouldn't trigger a onActiveToolChanged Observer or the deactivate method of a Tool?
-
@aerilius said:
... or the deactivate method of a Tool?
not the last part at least..
say (on mac) i activate the line tool then click a start point..
then i switch to a different su window and activate the circle tool.. click a start point for it..
go back to the original window and i click once to finish the line..
then to the 2nd window to click my radius point and complete the circle..point being, the tools don't deactivate (at least my interpretation of that word) when going to another window.
-
@aerilius said:
When a user selects another opened SketchUp document, is still the same tool active or does each model have its own "active" tool?
Obviously, on PC, where the two Sketchup processes are separate and independent, each has it's own Ruby process, and therefore the each application (which can only have a single model open,) is independent. The
Tools
stacks are different.On Mac, if two models are open under the MDI interface, each of them have their own active model ( a
Sketchup::Model
instance,) and therefore each of them has their OWN tool stack, referenced viaSketchup.active_model.tools()
; and their own active tool, referenced via theSketchup.active_model.tools().active_tool_id()
method.
This ALSO means that an model observer needs to be attached to EACH of the model instances to "watch" them independantly, as well as attaching a tools observer to each of the model's tool stacks.However, the API does NOT yet have a
Sketchup::ModelSet
collection class, but I HAVE filed an API feature request that one be added to the API, as well asonFocus()
andonBlur()
callbacks for theSketchup::ModelObserver
class. (During the v8.0 initial release beta cycle. Beta Testers can refer to FR#0105 and FR#0173.) -
Thanks, that's very helpful (and I was also wondering why such observers don't exist, good feature request).
I'll have to consider this for my webdialog callbacks.
Advertisement