sketchucation logo sketchucation
    • Login
    πŸ€‘ SketchPlus 1.3 | 44 Tools for $15 until June 20th Buy Now

    Select all and delete

    Scheduled Pinned Locked Moved Developers' Forum
    10 Posts 3 Posters 1.0k Views 3 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • chrisglasierC Offline
      chrisglasier
      last edited by

      Would anyone be kind enough to show me ruby code to clear the screen instead of the manual select all + delete? Thanks.

      Chris

      With TBA interfaces we can analyse what is to be achieved so that IT can help with automation to achieve it.

      1 Reply Last reply Reply Quote 0
      • M Offline
        morisdov
        last edited by

        Try -

        ents=Sketchup.active_model.active_entities
        ents.each {|ent| ents.erase_entities ent}

        Is it so hard to select all + delete ? just dont call it labor intensive πŸ˜‰

        1 Reply Last reply Reply Quote 0
        • chrisglasierC Offline
          chrisglasier
          last edited by

          Yes thanks it works just fine.

          The reason is illustrated by the attached screen print. When the user selects a name in the webdialog a new model is generated from all the products that are related to that name. There can be many thousands of names as their cells are animated to reveal just those that needed for use with the devices in the top panel or for navigation.

          The nameset html and javascripts are quite well advanced, but my Sketchup experiments have only just began ... hence the dumb questions.

          Thanks again

          Chris


          Sketchup nameset - step 2.jpg

          With TBA interfaces we can analyse what is to be achieved so that IT can help with automation to achieve it.

          1 Reply Last reply Reply Quote 0
          • J Offline
            Jim
            last edited by

            You can also start a new file from Ruby:

            
            Sketchup.file_new
            
            

            Hi

            1 Reply Last reply Reply Quote 0
            • chrisglasierC Offline
              chrisglasier
              last edited by

              Thanks Jim. It also works of course and there is not so much typing!

              With TBA interfaces we can analyse what is to be achieved so that IT can help with automation to achieve it.

              1 Reply Last reply Reply Quote 0
              • M Offline
                morisdov
                last edited by

                I am also linking 3D models to a backoffice ERP system.

                the following XML+Webdialog reporter ruby might be of use to you -
                http://morisdov.googlepages.com/xml_dictionary_attributes.zip
                I am working on a webdialog editor version , but i have issues with variable types and arrays editing so its not for public release, let me know if you need it.

                1 Reply Last reply Reply Quote 0
                • chrisglasierC Offline
                  chrisglasier
                  last edited by

                  As I wrote somewhere else in the forum, I am at GMT + 8 so I would like to look at your stuff tomorrow.

                  Right now I am pretty exhausted after trillions of selectAll deletes!

                  Chris

                  With TBA interfaces we can analyse what is to be achieved so that IT can help with automation to achieve it.

                  1 Reply Last reply Reply Quote 0
                  • chrisglasierC Offline
                    chrisglasier
                    last edited by

                    @morisdov said:

                    I am also linking 3D models to a backoffice ERP system.

                    Thanks, morisdov, for the XML+webdialog reporter ruby ... haven't quite figured out the whys and wherefores yet; I think at my early stage the webdialog editor version might be too advanced.

                    But I would like to explain that what I am making (I call namesets) is more about collecting names and providing devices for manipulating them into models, schedules, messages and so on rather than linking models back to enterprise resource planning. I see namesets as one method for communities like this one to develop an object oriented way of working, from which society can further develop new commercial activities. This is similar to Google providing a free version of SketchUp, presumably with the idea of selling more Pro versions and to Smustard specialising in writing Ruby scripts some of which they sell.

                    Names of objects generally mean products; products need advertising; manufacturers could produce advertising suitable for reuse in their customers' work. Models are attractors; the higher quality of the model with the lowest weight the better; this could mean more Pro versions, more scripts, a new profession of nameset makers, animations in addition to bar charts ... what do you think?

                    Chris

                    With TBA interfaces we can analyse what is to be achieved so that IT can help with automation to achieve it.

                    1 Reply Last reply Reply Quote 0
                    • M Offline
                      morisdov
                      last edited by

                      I agree with your thinking.

                      if you expect financial rewards from the add-on's you develop for sketchup, you must touch base with furniture (and related) manufacturers as soon as possible, much before you are finished with your development.

                      for my projects sketchup is just a half way tool to google earth as the end platform.
                      I just automate 3D models manipulation and place em on google earth.
                      I have only modest familiarity with the main base of sketchup "manual" users.
                      Corporations controlling their assets in 3D in real time are motivated by a different logic.

                      Update us on your progress in a new forum thread hopefully soon.

                      1 Reply Last reply Reply Quote 0
                      • chrisglasierC Offline
                        chrisglasier
                        last edited by

                        @morisdov said:

                        Update us on your progress in a new forum thread hopefully soon.

                        I posted a something in the ideas box of the corner bar.

                        But to finish off the select all delete business so far I find the following works:

                        @dlg.add_action_callback("clearer") {|d, p|
                        ents=Sketchup.active_model.active_entities
                        status = ents.clear! }

                        After a while the other two brought up some frightening looking splat windows.

                        Thanks

                        Chris

                        With TBA interfaces we can analyse what is to be achieved so that IT can help with automation to achieve it.

                        1 Reply Last reply Reply Quote 0
                        • 1 / 1
                        • First post
                          Last post
                        Buy SketchPlus
                        Buy SUbD
                        Buy WrapR
                        Buy eBook
                        Buy Modelur
                        Buy Vertex Tools
                        Buy SketchCuisine
                        Buy FormFonts

                        Advertisement