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)))
Vertice.Transform(MoveVertices)
Next
But its not working.
Do I need to CommitChanges somewhere or add a new object like duplicate?
Edit:
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)
Next
Brep.SetVertices()
doc.Objects.AddBrep(Brep)
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.
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);
code:
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
Else
xForm(0, 0) = 1.0
End If
If SetY Then
xForm(1, 3) = Point.Y
Else
xForm(1, 1) = 1.0
End If
If SetZ Then
xForm(2, 3) = Point.Z
Else
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)