Selection.add ??? possible?
-
hi,
when i havemodel = Sketchup.active_model sel = model.selection
and 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_entities
context...
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)
Advertisement