Window or crossing box selection across groups
-
What I'm looking for is basically an alternate version of the select tool that allows me to make selections using crossing box or window that spans across all zones. Basically as if my model was exploded. Could dig all the way into groups, or maybe user configurable number of levels. The SketchUp equivalent of Adobe's Direct Selection tool. I think this is doable, but didn't know if anyone has already tackled it. For window faces would only be included if all points of the face were inducing in the search area. For crossing box if any of a faces points were included in search area that face would be selected.
I'm looking at this for the OpenStudio Plugin. I can't have users explode the model because I have equivalent faces on separate groups that would be merged if I exploded, and then re-grouped objects.
A related issue to this. If you select a face in a number of groups, and move X value by 10',any rotated zones will have un-expected results. Makes using the basic move tool after this kind of selection tricky, hate to have to build special move tool for this.
David
-
David,
This is doable, but you would have to stay inside an interactive plugin that will perform the operations (with custom tools like paint, deform, move, push pull...). For instance, in Curviloft, you can select edges within components and groups at any level (and indeed in differents components), but you can operate on them only via Curviloft, not with SU tools.
Selection inside components and groups is not possible in Sketchup native mode, and therefore your multi-selection would be ineffective if you use the standard SU tools (paint, move, etc...).
Fredo
-
I have done some testing with standard move tool, and if my groups have not been rotated all is well. It is possible I can run through process to un-rotate groups prior to this if people want to use it, or make a custom move tool. Move is the main tool I'm interested in. Currently I'm making my multi-group selection by searching attributes associated with the surfaces, but the ideal solution is to search against a crossing box or window. Haven't really looked at API access to select tool to see if I can loop through a test through all groups against that selection box.
non rotated groups
http://www.youtube.com/watch?v=zZdcWmX3mMMIf I rotate the groups, then the movement is incorrect in the rotated zone. It is moving along x relative to group vs. model origin.
http://www.youtube.com/watch?v=Tsx3dlSb0uI -
Selecting entities outside the current context opens a can of worms - gremlins are quite likely to appear as no native functions even consider the possibility of cross-context-selection.
-
So if I decide I want to try to open that can of worms, how would you go about creating the section across the groups. For me the ideal workflow would be to create an alternative version of sketchUp's select tool that works more like Adobe's direct select tool (digging into nested groups to make selection). I probably only need to dig one level down for my needs.
I guess using the existing crossing box I would want to find out what points in the model fall within a certain x,y range for the current camera and screen view. If I can grab the x,y clicks for my crossing/box window, then I can use this method to test the points in the model
http://code.google.com/intl/zh-CN/apis/sketchup/docs/ourdoc/view.html#screen_coordsPickhelper seems like it would be useful for finding screen coordinates of clicks, but may have to click two separate points vs. a click/drag operation?
http://code.google.com/intl/zh-CN/apis/sketchup/docs/ourdoc/pickhelper.htmlIf the above solution doesn't work I have two other ideas, but neither one is particularly clean.
a. require the user to draw a physical box which will serve as a bounding box for the crossing box or window
b. Create copy of all points in the model to loose top level objects. I could then use the existing select tool to make a crossing box or window, but would need to associate each temporary point with the original nested point before I could run an operation on the selection. -
So here my latest thought. Create a tool to draw a 2d rectangle on screen. Depending upon the direction of the rectangle it becomes a window or crossing box (or I have separate tools for each so direction it is drawn doesn't play a role).
Then I use view.PickRay on the corners of the 2d rectangle.
If I am using my rectangle as a window, I test vector from camera to each point in the model to see if it lies within the rectangle (x and y ray range test against my rectangle). If all the points of a face are pass the test that face and attached edges are in the selection (in my case I only care about faces, not edges). If any point of a face fails the test then that face is not in the selection.
If I am using my rectangle as a crossing box, then I want to test each face in my model to see if it intersects with any of the four rays from my 2d triangle. If any of the four rays intersect a face, then that face is included in the selection. This doesn't address edges, which is OK for my use.
If I wanted to get edges in crossing box, it would be great to convert the edge to 2d line on screen, and then see if the edge points either pass the ray range test, or interest the lines that make up the rectangle. Haven't dug into the API to see if that is even possible.)
An entirely different approach (again just for faces, and in this case just window, not crossing box) would be to have the script first copy every point in the model to a loose top level point. Then I would activate the built in SketchUp selection tool. The user would make a section like they normally do. This would create an array of 3d points. I could then test the nested faces. If all of the points of a given face are in the 3d point array, then that face would be selected. I would loop through all faces, and then throw away the temporary top level points used to make the array in the first place. This solution doesn't seem nearly as clean as the first solution.
Advertisement