Selection.add ??? possible?
-
hi,
when i havemodel = Sketchup.active_model sel = model.selectionand create a edge-copy from a given edge (from an edge-array : edges)
entities2 = Sketchup.active_model.entities vertex = edges[0].start pt_start = vertex.position vertex = edges[0].end pt_end = vertex.position edge2 = entities2.add_line(pt_start, pt_end)how could i ADD the new edge2 to the sel ??? (merge ?)
is it possible?after this the further code should realise sel incl. the new adge2 as USER's SELECTION .
thanx
stan -
I don't think Sketchup will allow you to place one edge on top another in the same context. The copy would have to be created in a group then sel.add edge2 would add it to the selection.
-
sel.add(edge2)BUT best to test it's valid -
edge2.valid?BUT beware!
The entity must be in the
model.active_entitiescontext...
You can 'cross-thread' selected entities BUT it will crash SketchUp... -
Was that a question on how? Or did you experience issues with Selection.add (because that is exactly the API method to do what you requested: http://www.sketchup.com/intl/en/developer/docs/ourdoc/selection#add)
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better π
Register LoginAdvertisement