Ghpython executing rhino command and get the result inside grasshopper?

obj = sc.doc.Objects.Add(x)
if (rs.SelectObject(obj)):
    rs.Command("_-hydrostatics _Enter _HistoryWindow")
    history = rs.CommandHistory()
    last_index = history.rfind("Hydrostatics")
    a = history[last_index:]
    sc.doc.Objects.Delete(rs.coercerhinoobject(obj))


IVELIN.gh (17.4 KB)

3 Likes