Cant get transform(split(...) running


#1

Hi I’m trying to use rhinocommon instead of runscript and I have no idea what I’m doing here. This is what I got but what do I fill in the …?

Dim element As Rhino.DocObjects.ObjRef() = Nothing
Dim element2 = Rhino.Input.RhinoGet.GetMultipleObjects("Select splitting objects", False, DocObjects.ObjectType.Surface, element)


If element2 <> Rhino.Commands.Result.Success Then
Return element2
End If

doc.Objects.UnselectAll()

Dim curve As Rhino.DocObjects.ObjRef = Nothing
Dim curve2 = Rhino.Input.RhinoGet.GetOneObject("Select curve", False, DocObjects.ObjectType.Curve, curve)

If curve2 <> Rhino.Commands.Result.Success Then
Return curve2
End If

Dim test2 = curve.Curve

Dim test = element(0).Geometry.Transform(Split(test2))

Who can help me out here?


(Dale Fugier) #2

The only way you learn is by trying. :wink:

It appears you are trying to split a surface with curve. RhinoCommon does not have a function that will do this. So, you can try to extrude the curve through the surface and then split the surface with the extruded surface. Or, you can script the Split command.


#3

Yes I found out the last way whith rhinoscipt :slight_smile: Now I want to delete the 2 outer parts and I will try to do this with extruding the curve and check if the surface that needs to be deleted is inside the extruded surface or not. This is possible right?

Guess not. :stuck_out_tongue: Just have to figure out how to check if the srf is outside of the crv :stuck_out_tongue:


#4

Guess I can’t use the script anyways have this:

            Dim go = New Rhino.Input.Custom.GetObject()
            go.SetCommandPrompt("Select closed surface or polysurface")
            go.GeometryFilter = Rhino.DocObjects.ObjectType.Surface Or Rhino.DocObjects.ObjectType.Brep
            go.GeometryAttributeFilter = Rhino.Input.Custom.GeometryAttributeFilter.ClosedSurface Or Rhino.Input.Custom.GeometryAttributeFilter.ClosedPolysrf
            go.Get()
            If go.CommandResult() <> Result.Success Then
                Return go.CommandResult()
            End If


            Dim brep As Rhino.Geometry.Brep = go.Object(0).Brep
            If brep Is Nothing Then
                Return Result.Failure
            End If

            RhinoApp.RunScript("_selnone -_selname elementL", False)


            Dim refs As Rhino.DocObjects.ObjRef() = Nothing
            Dim rc As Result = Rhino.Input.RhinoGet.GetMultipleObjects("Select srf to trim", False, DocObjects.ObjectType.Surface, refs)
            If rc <> Result.Success Then
                Return rc
            End If

             doc.Objects.UnselectAll()

            Dim tol As Double = doc.ModelAbsoluteTolerance

            'voor elk punt in ptsel doe: check of deze in ptsel zit anders verwijder het punt
            For Each ref As Rhino.DocObjects.ObjRef In refs
               
                If pt IsNot Nothing Then

                    pt.Trim(brep, tol)

                End If
            Next

But tbh. I have no idea what to fill in interval U/V and what that means. So. A tip would be nice please.

Well I guess I just have to try a bit longer before asking xD All figured out now. Thanks anyways :slight_smile: Sorry for asking before trying enough xD