2D drafting ruby
-
Sometimes I just want 2D for a little while. I can get by, but I have a script I'd really like to write or have written. I don't know enough ruby for this, but I do know that this can be done and I think I have come up with a reasonably simple way to do it using existing tools. Basically all I want is a toolbar button (shows on/off similar to the Show Section Planes button, for instance) that wraps up several commands and toggles them all together as follows:
When "2D" is turned On: switch to top view, turn perspective off, and lock camera to pan only (which is probably the tricky part) when using the mouse wheel. I don't know enough about ruby to know if you can change the button definition to the Pan tool and back, or if you can just lock on the Shift modifier for the tool, which would act the same way. This would simulate (for my habits at least) 2D drafting, even when switching between top/front/side views.
Then when 2D is turned Off, switch perspective or || projection back on (whichever was in use before) and give the mouse button back it's usually functionality. Also, maybe switch to another view, such as wherever the camera position was before 2D mode was activated or maybe to a certain scene, but this wouldn't always be desirable. Maybe that part could have an option setting somewhere if anyone wanted it.
Eventually I want to learn ruby myself, and this would probably be an easy learning project, but I learn best by digging through other people's scripts and looking at the pieces. I'd be happy to do the button icon or having someone else do one if they want. Is anyone up to helping me tackle such a tool?edit: I know this can already be done (mostly) with scenes, but I would really like a plugin that does it all at once, especially toggling the mouse behavior; otherwise I have to create scenes in each model I do. Always. Every time. Forever.
Doesn't even need a button, a place in the menus (camera -> 2D Mode with a check might be appropriate?) would be great - anywhere I can tack a shortcut key to it.[birchins]
-
Hi brichins,
Everything you want, except disabling Orbit, can be done quite quickly using Pages(version 5 or earlier)/Scenes
Anssi
-
Yes, I know. I actually posted a longer version of this request over at the Google groups, but thought it was rather long. Although I can do all of the above with existing tools, scenes, shortcuts etc., I would really like a 1-button command for everything at once - hence a plugin - and especially to toggle the mouse behavior.
[birchins]
-
Set the 2D scene and a 3D scene up once in an empty drawing and make it your template so that every project from now on will work for you.
Kelly
-
sigh yes, I know I can do that too. That is a perfectly good solution, and would certainly work. I appreciate your suggestions, really I do. I am glad that people here are so willing to share their knowledge and help each other learn; SU forums are where I have learned the most about how to use SU quickly and powerfully.
However, I still want a script that does exactly what I described. I'm digging through existing scripts and Ruby tutorials/documentation trying to find the correct classes, variables, methods etc. for doing this, and am just hoping someone can help me get there faster. Especially with the camera part: I would like to detect the nearest ortho view (top, front, left, etc) and switch to that automatically. Any idea on how to do that? I know the Iso view does something similar. Otherwise with the scene approach, I have to create a scene for each default view, and iso views if I want those. What if the object isn't perpendicular to those views, or I want to align to a face and draw on it? Too many scenes.
Also, I would like a toolbar button that indicates the status and/or a menu item with a check mark that toggles appropriately. How would I go about that?
[birchins]
-
this should go on the wish list... mmm 2d drafting... but what about z plane problems? if you are working on the top plate of a house in 2D what keeps a new line from attaching at the bottom plate or window sill?
-
Of course, such a script wouldn't truly be 2D drafting - just a quick way to change several camera settings (i.e. turn off perspective and switch to an ortho view) and modify the mouse behavior. You would still only see whatever is on top/front and draw on that surface. A true 2D plugin would be a headache to write and I don't think would add much; there are plenty of 2D programs out there already.
[birchins]
-
why settle for that... if they're gonna write something... allow us to select a plane such a the section and only work in it...
-
past the scope of what I was looking at, but that could certainly be useful at times!
[birchins]
-
Okay, I hear you. I can't promise it will happen quickly, but it's on my radar now.
-
Rick you rock man...
-
What about this approach for a 2d drafting ruby - disabling an axis, as opposed to changing perspectives and cameras etc ...
...
A ruby (eg connected to command buttons) that only allows drafting in 2 axes (ie DISABLES one axis).That way, you could draw in 2d - safe in the knowledge that your geometry wouldn't be wandering off in the blue (z) direction for instance.
The buttons would allow you to draw in ANY 2 axes but not a third - would be VERY useful.
Even drawing in this proposed 2d drawing mode I can still see that it would be VERY useful to have the ability to be able to have a perspective view on an object eg drawing detail on the gable end of a building etc
.....
You could also use this feature then for drawing in plan mode with perspective off if required - leaving it up to the user to change cameras, perspectives etc as needed.
...
It would be a ruby that could lock both the red and green axes (for example) - AT THE SAME TIME.
...
Regards
Howard L' -
Thanks for all the help and suggestions, some great ideas coming out. Howard - sounds like that might work, but what if you happen to want a non-axial plane such as a gable wing that comes off the rest of the building at an angle?
I asked this over at the Google forum and have got some good suggestions about how to get started. From some of the Smustard guys actually, so that worked out well. Here's the link if anyone's interesting in joining/pursuing this idea over there.
sorry the link doesn't seem to be parsing correctly; what'd I do wrong?
[birchins]
-
I corrected it for you. All you need to do is paste the link in. I think because it was so long when you put the brackets on it did not want to behave.
-
Link works now - thanks!
[birchins]
-
great idea.... for the locking axis' as for how to make a gable line in that mode, simply draw a straight flat line and rotate it up to the angle... may have to put it in a group.
-
When I was doing animation back in the day on my Amiga A4000 (yes, vintage!), the 3D app I was using was called Imagine. It had 2D views that would not allow the user to orbit, and then it had an Iso view that would remember your camera position, lens and zoom level.
Would this be of interest as a feature request for future versions of SketchUp? We already have the Views toolbar, but perhaps we can enhance this so that the 2D views can be locked so that you can't orbit, and the iso view remembers your last camera position.
I can pass that along.
Sound good?
- CraigD
-
sounds good... however the axis lock of the line usage really interests me... there are many times when I need to work in a certain plane and would love to lock it down...
-
I'd like to request that as a feature, sure! I don't think that the standard Views buttons would have to create a lock - that's the point of switching the mouse button to pan instead of orbit when the 2D lock is on (although that's just my preference - do most people primarily use the wheel to navigate?). You could still switch views or orbit manually; align camera to face would also work. The 2D button could sit on the Views bar though; I would think it could indicate on/off like the X-plane button. Also in the menus it should have a check mark, like Perspective.
I'm not even sure you'd need to go back to whatever view/camera was active before 2D was enabled; how often would you really need to? If it was a common enough view you'd probably have a scene for it. That raises another point though - if you were in 2D view and clicked a scene that had perspective, should 2D stay on?
One more thought; perhaps "2D Mode" could show in the upper left corner, similar to "Two-point perspective" and "Top" or "Front" when those are active.
[birchins]
-
This idea is getting me excited. Could it include a smart-wall function to draw interior and exterior lines in one step? The thickness would be user-defined, of course, with an option for defining the height. It also could be integrated with the door and windowizer scripts to automatically place components that would become 3D when viewed in perspective mode. Perhaps this is getting ahead of things, but it does not seem like it would be too difficult to integrate these features, especially since some of the functionality is already developed.
I think it would be really great to have a better integration with dimensioning. In 2D, dimensioning would seem to be much more managable to script. There was a thread about auto-dimensioning somewhere, this would be the perfect opportunity to integrate this kind of feature.
And then there would be potential integration with the housebuilder features! I'd better stop...
Advertisement