EricM
(Eric Paul Marvets)
May 12, 2018, 9:32pm
1
Say I have two crvs that are lofted into a srf. Can I replace one of the curves, as in doc.Objects.Replace(crvA, crvB) to maintain the history? Maybe an undocumented command that swaps the GUID of two objs?
And just to be sure, the only way you can clone an object and its history is to import them?
pascal
(Pascal Golay)
May 12, 2018, 10:27pm
2
Hi Eric - you can try something like this python - the second curve gets the ID of the first, the first gets a new id.
import Rhino
import rhinoscriptsyntax as rs
import scriptcontext as sc
def ReplaceParentCurve():
id1 = rs.GetObject("Select the curveto replace.", 4, preselect=True)
if not id1: return
id2 = rs.GetObject("Select the replacement curve.", 4)
if not id2: return
crv2 = sc.doc.Objects.Find(id2).Geometry
rs.CopyObject(id1)
sc.doc.Objects.Replace(id1, crv2)
sc.doc.Views.Redraw()
if __name__ == "__main__":ReplaceParentCurve()
-Pascal
EricM
(Eric Paul Marvets)
May 12, 2018, 10:45pm
3
Thanks, Pascal. And there’s no way to clone something with its history other than import? I asked in V5, but just wanted to make sure in V6.
pascal
(Pascal Golay)
May 13, 2018, 1:16am
4
Hello - as far as I know that is the only available trick…
-Pascal