Custom SetPT


I’m trying to create a SetPt function.

This is what I’m doing:

For Each Vertice As Rhino.Geometry.BrepVertex In ObjRef.Brep.Vertices

Dim Z As Double = Vertice.Location.Z
Dim MoveVertices As Geometry.Transform = Rhino.Geometry.Transform.Translation(New Rhino.Geometry.Vector3d(New Rhino.Geometry.Point3d(0, 0, 0 - Z)))


But its not working.
Do I need to CommitChanges somewhere or add a new object like duplicate?


This also doesnt work :(:

For Each Vertice As Rhino.Geometry.BrepVertex In Brep.Vertices
                Vertice.Location = New Geometry.Point3d(Vertice.Location.X, Vertice.Location.Y, 0)

What are you trying to accomplish? Moving only the vertices of a BREP will accomplish nothing, except probably making the BREP invalid, because the BREP datastructure is more complex.


I was trying to make a custom SetPt. So I want to get the “control points” of a brep then set them too Z = 0

the same as this does:

“_pointson _selpt -_setpt X=No Y=No 0,0,0 _pointsoff”

Try this:


Where is SelectObjects hidden? and TransformObjects
I’ve imported the same libraries but I can’t get that one to work.

also gx doesnt know   gx.AddTransformObjects(list);


Public Class GetSetPtTransform
        Public Sub GetSetPtTransform(ByVal bSetX As Boolean, ByVal bSetY As Boolean, ByVal bSetZ As Boolean)
            SetX = bSetX
            SetY = bSetY
            SetZ = bSetZ
        End Sub

Public SetX As Boolean
        Public SetY As Boolean
        Public SetZ As Boolean

Public Overridable Function CalculateTransform(ByVal Viewport As Rhino.Display.RhinoViewport, ByVal Point As Geometry.Point3d)
            Dim xForm As Rhino.Geometry.Transform = New Rhino.Geometry.Transform(0)
            If SetX Then
                xForm(0, 3) = Point.X
                xForm(0, 0) = 1.0
            End If

If SetY Then
                xForm(1, 3) = Point.Y
                xForm(1, 1) = 1.0
            End If

If SetZ Then
                xForm(2, 3) = Point.Z
                xForm(2, 2) = 1.0
            End If

xForm(3, 3) = 1

Return xForm
        End Function
    End Class

And in my function

Dim gx As New GetSetPtTransform
            gx.GetSetPtTransform(False, False, True)
   Dim list As TransformObjectList = New TransformObjectList()
            rc = SelectObjects(“Select objects to transform”, list)

Notice what class the command inherits from?

You mean :smile:

internal class GetSetPtTransform : GetTransform ?

How do I translate this to

No, this:

public class SampleCsSetPt : TransformCommand

How to refer too that in Vb.Net?

Instead of this:

Public Class JordyCommand
    Inherits Command

Do this:

Public Class JordyCommand
    Inherits TransformCommand

Learned something new again thanks. I’m getting there xD

This link is broken

1 Like