How to update geometry after making a change to it? (SwapEdge)


I am trying to
of a mesh box that I triangulated.

 #I get the box with:
 Mesh = rs.coercemesh(meshID)
 # The ID of an edge which can be swapped
 EdgeID = 10

 #And then try to pass this:

But nothing happens, there is no error as well.

Any idea why, am I approaching this correctly?

Hi @qtov,

After modifying the mesh, make sure to replace the original mesh with the modified one.

import rhinoscriptsyntax as rs
import scriptcontext as sc

mesh_id = rs.GetObject("Select mesh")
mesh = rs.coercemesh(mesh_id)
edge_index = 10
sc.doc.Objects.Replace(mesh_id, mesh)

– Dale

1 Like

Hello Dale,

Thank you. Appreciate the solution. Works perfect!