Select all and delete
-
Would anyone be kind enough to show me ruby code to clear the screen instead of the manual select all + delete? Thanks.
Chris
-
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
-
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
-
You can also start a new file from Ruby:
Sketchup.file_new
-
Thanks Jim. It also works of course and there is not so much typing!
-
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. -
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
-
@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
-
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.
-
@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
Advertisement