Untrim command available in Python?

Is it possible to access something like the Untrim command in Python? I want to step through a list of trimmed surfaces and untrim all of them. If not, any suggestions on how to do it?

Well, you could simply script the Untrim command with rs.Command(). Otherwise, there appears to be no rhinoscriptsyntax direct method, so you would need to delve into a little RhinoCommon. Sample code:

import rhinoscriptsyntax as rs
import scriptcontext as sc
import Rhino

srfID=rs.GetObject("Select a trimmed surface to untrim",8,preselect=True)
if rs.IsSurfaceTrimmed(srfID):
    if isinstance(srf,Rhino.Geometry.Brep):

(The above deletes the original input, the untrimmed surface will have the same guid as the original)


_UntrimAll would be the non-scripted solution
just in case…

1 Like