Scene name required

Hello,
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.
Thanks

1 Like

https://extensions.sketchup.com/extension/69e5e033-5015-431d-a33f-240d159a7107/named-scene2

2023-01-13_17-39-37

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')[0]
      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:

2 Likes

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

1 Like

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 :slight_smile:
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…
My 2cents…

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…

3 Likes

Hi, I developed a SketchUp extension called Name Page that you can install. The plugin creates a new page with a user-specified name.

name_page_final

>>> Click Here to Download the SketchUp Extension <<<

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:

  1. Go to the menu Extensions > Extension Manager
  2. A window will appear and below there is a blue button named ‘Install Extension’
  3. Search for the RBZ file you downloaded from my Gumroad store, select it and click open
  4. 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: icon

If you don’t see the Toolbar button right away after installing the extension then follow these instructions:

  1. Go to View > Toolbars...
  2. A toolbars window will open
  3. 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

One more thing…

You can add a keyboard shortcut to activate the ‘Name Page’ extension to accelerate even more your workflow.

Instructions:

  1. Windows > Preferences
  2. A SketchUp Preferences window will appear.
  3. Select the Shortcuts tab on the left side.
  4. In the Filter input box type: Name Page
  5. Under Function select: Extensions/i3D/Name Page/Create Page with Name
  6. Under Add shortcut type the desired keyboard shortcut and click the + button to assign it.
  7. 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.

1 Like

thanks @indie3d. Great job . i’ll try this at my office tomorrow !

1 Like

Thanks @indie3d
With the right keyboard shortcut, i really love it !

1 Like