When you create a scene, Sketchup does not ask for anything, and yet I would like to have a window that opens to systematically give a name and avoid having to modify the name after the fact.
Is there an adjustment that automatically requires entering a name when creating a scene?
I would like it to work as for section plans.
Here is a Ruby method that prompts the user to enter a page name, and then creates a new page in SketchUp with that name:
Copy the Ruby script and run it inside SketchUp through the Ruby Console or use Ruby Code Editor by alexschreyer.
# Change the first module name to the developer namespace # - In this example, I used EstOuest, the name of the person asking the question # Change the submodule for something that best describes what the Script is solving. # - In this example, I used 'NamePage' module EstOuest module NamePage def self.create_page model = Sketchup.active_model prompts = ['Page Name:'] defaults = [''] input = UI.inputbox(prompts, defaults, 'Enter a name for the new page') model.pages.add input end end end EstOuest::NamePage.create_page
After you customize the script and it does what you want, then you might want to create a toolbar button for activating the script.
If you need help with that then let us know.
Note: This is good practice for someone who Masters SketchUp and might want to learn how to develop their own tools for SketchUp.
Visit the link below to study the SketchUp Ruby API Documentation:
Thank you @dezmo. I tried this extension before writing my first message. But sketchup as crashed when I created a scene. Then he was trembling when create new scenes without displaying any window. So I uninstalled
Oh ! Thank you @indie3d . It seem to be interesting. I will try it on this weekend
Thanks for your help.
But I didn’t understand how it all works.
I pasted the script in the ruby console.
I don’t know if changing the developer name is important or not. What is its role?
The developer name changed or not I get the following sentence: => :create_page
I don’t know if I have to write a scene name and Enter? (my test gives an error and produces nothing)
Or if I have to create a scene from the + button of the scene window and wait for a window to ask me a name (my test was not conclusive)
I am really a noob in ruby and in programming in general
I’m not sure I want to insist on this way.
The best would be that the function is directly included in a next version of sketchup.
Doesn’t the Scene Tray do that?
Having watched this thread evolve…
If you have the model’s scene tabs set to be displayed, then by using the tabs’ drop-down menus you can easily add a new scene, or delete a scene, or simply rename an existing scene.
New scenes are named using the default Scene 1, Scene 2 etc.
If you want your scenes to have different default names then you need an extension to add them using a preset naming convention, or typed in name - however, the only saving in scene naming clicks and typing is minimal compared to the in-built system.
The Scenes dialog allows similar post-creation editing of the names etc as an alternative…
You are making more work trying to fix something that IMHO is not broken.
There are far more broken things to fix…
Hi, I developed a SketchUp extension called
Name Page that you can install. The plugin creates a new page with a user-specified name.
After clicking the link above, you will be redirected to my Gumroad Store where you can look for the ‘Name Page’ SketchUp extension.
The extension is Free if you enter $0 in the
Name a fair price input box. You will then access the download page where you can download an
.rbz file that you can install from SketchUp.
Steps to Install SketchUp Extension with RBZ file:
- Go to the menu
Extensions > Extension Manager
- A window will appear and below there is a blue button named ‘Install Extension’
- Search for the RBZ file you downloaded from my Gumroad store, select it and click open
- Done. Restart SketchUp and then follow the steps below.
You can then activate the extension by clicking a Toolbar button or through the Extension menu.
Here is the icon for the Toolbar button:
If you don’t see the Toolbar button right away after installing the extension then follow these instructions:
- Go to
View > Toolbars...
- A toolbars window will open
- Find an item named ‘Name Page’ and make sure the checkmark is checked
Another way is to activate the script under the Plugins or Extension menu.
Extensions > i3D > Name Page > Create Page with Name
You can add a keyboard shortcut to activate the ‘Name Page’ extension to accelerate even more your workflow.
- Windows > Preferences
- A SketchUp Preferences window will appear.
- Select the Shortcuts tab on the left side.
- In the Filter input box type: Name Page
- Under Function select: Extensions/i3D/Name Page/Create Page with Name
- Under Add shortcut type the desired keyboard shortcut and click the + button to assign it.
- Done. Now you can be much faster creating pages/scenes with custom names.
I hope this helps in case SketchUp doesn’t include this feature.
thanks @indie3d. Great job . i’ll try this at my office tomorrow !
With the right keyboard shortcut, i really love it !