Set centre point on multiple objects?
-
Hi,
I have done this before but have now forgot how I did it!
I have multiple objects selected and I wish to place a centre point on all of them.
At the moment I can only create one centre point in the middle of them all.
As you can see from the atttached image I am using a ruby script called 'centrepoint'.
I'm pretty sure that is what I used last time but maybe it was just a similar ruby script?I am trying to follow through a guide created by 'Howard Leslie' who kindly helped me with this previously. I have attached this also, so you can see better what I am trying to do.
Thanks.
Mr S
-
I don't think that's my guide - or my memory is worse that I think it is . . . I can't see how to get all the centerpoints at one go. Maybe someone could extend a script to do this?
Bob
-
Hi Bob,
Sorry, about that.
You also helped out with this problem but it was actually Howard Leslie who provided the tutorial. I have edited my original post.Mr S.
-
Not a fully-fleshed out plugin, but you can type (or copy & paste) this into the Ruby Console, one line at a time.
# Select entities first UI.menu("Plugins).add_item("Group Centerpoint") { m = Sketchup.active_model; e = m.active_entities; s = m.selection groups = s.find_all {|g| g.typename == "Group"} groups.each {|g| e.add_cpoint(g.bounds.center)} }
-
-
Hi Jim,
Thanks for trying to help, but...
I ran each command one at a time in the Ruby command console but nothing seemed to happen.
This will be user error, I know!This is really frustrating because I have done this in the past using the guide shown.
I know I was able to create centre points on hundreds of multiple objects using a Ruby plugin. Just wish I could remember how I did it.Here is the original link for the "Howard Leslie" guide: http://www.sketchucation.com/forums/scf/viewtopic.php?f=22&t=4276
Regards
Mr S -
Hi Jim,
Sorry, but after adding the plugin I received this error on restarting SketchUp.
See attachedMr S
-
-
I'm probably sticking my nose in where it doesn't belong but what if you made the symbols instances of the same component using ApplyTo.rb? Then, while editing one of them, you could add the guidepoint to all of them. Explode them to separate the geometry from the guidepoints. Use the Selection filters to select the geometry leaving the the guidepoints. The selected geometry could then be hidden.
Just an idea.
-
Hi Jim,
Yipee!!
You are another Ruby genius who has helped me out.
Thanks very much for taking the time to help me out.(Still wish I could remember how I did it originally!)
Regards
Mr S -
Hi Jim,
Perhaps my "Yipee" was premature!
I have attached 2 SketchUp files.
One is from the original Site Survey guide. Your script works on this.
The second one is a section of the file I am currently working on. your script doesn't seem to work.For the life of me I can't see any obvious reason why this would happen.
Can you figure it out?Regards
Mr S
-
Mr S,
Jim's Script appears to work on Groups only - you have Components - thats probably why it doesn't work with your data.
...
A few possible solutions;-
Is your original data in a Spreadsheet or Text File ???
I think Didier has a script to import this data directly.
Very useful for large numbers of points. -
Get Jim to adjust his script to work on Components also.
-
TIG has a useful script - AddVertex+
Ask TIG to adjust his script to give you an option to add a Vertex at the Intersections only (on a large selection set) - and have the ability to mine down into Components and Groups (something he has added to numerous scripts he's written).
...
Regards
Howard L'
-
-
Yeah, the script was a quickie I did before work this morning. I was originally just going to make a copy & paste one-liner for the Ruby Console, but putting it in a menu was easy enough. I just used Groups because that is all that the first example model had.
Update: TIG has updated this script to work on Groups and Componenets. See the following link:
http://www.sketchucation.com/forums/scf/viewtopic.php?f=180&t=11081
Advertisement