送一一段VB的脚本吧,直接把下面的内容复制到按钮的左键或右键内即可- ! -RunScript (
- CutSolid
- Sub CutSolid ()
- Dim arrObjects, arrPoints, arrVector1, arrVector2, arrBD, strCut
- arrObjects = Rhino.GetObjects ("Select Solids to Cut",8+16,vbTrue,vbTrue)
- If IsNull(arrObjects) Then Exit Sub
- arrPoints = Rhino.GetPoints (True, False , "Pick 3 Points",, 3 )
- If IsNull(arrPoints) Then Exit Sub
- If UBound(arrPoints) <2 Then Exit Sub
- Rhino.EnableRedraw False
- arrVector1= Rhino.VectorCreate (arrPoints(0), arrPoints(1) )
- arrVector2= Rhino.VectorCreate (arrPoints(0), arrPoints(2) )
- strCut = Rhino.AddCutPlane (arrObjects, arrPoints(0), arrPoints(1) , arrVector2)
- arrBD = Rhino.BooleanDifference (arrObjects, Array(strCut) )
- If IsArray(arrBD) Then
- Rhino.ShrinkTrimmedSurface arrBD(0)
- Rhino.SelectObjects arrBD
- Else
- Rhino.DeleteObject strCut
- Rhino.Print "Failed to Cut"
- End If
- Rhino.EnableRedraw True
- End Sub
- )
复制代码 |