Grasshopper

algorithmic modeling for Rhino

Hi!,

i want to changes the X, Y and Z point values in vb but sayme "invalid cast: Number>> Point3d. 

Protected Overrides Sub SolveInstance(ByVal DA As Grasshopper.Kernel.IGH_DataAccess)
Dim Pa As New Point3d
Dim x As Double
Dim y As Double
Dim z As Double
If (Not DA.GetData(0, x)) Then Return
If (Not DA.GetData(0, y)) Then Return
If (Not DA.GetData(0, z)) Then Return
If (Not DA.GetData(0, Pa)) Then Return
Pa.X = Pa.X + x
Pa.Y = Pa.Y + y
Pa.Z = Pa.Z + z

DA.SetData(0, Pa)
End Sub

Best!

Views: 271

Replies to This Discussion

Hi Leonel, your script is looking for all four input parameters in input (0)...

use:
If (Not DA.GetData(0, x)) Then Return
If (Not DA.GetData(1, y)) Then Return
If (Not DA.GetData(2, z)) Then Return
If (Not DA.GetData(3, Pa)) Then Return
or something like that that matches the order of your inputs.

Notice that you can also just use native GH components to sum points:
for example {1,2,3} + {4,5,6} = {5,7,9}

Hi Pieter! thx for your reply, now it´s found. i want to develop a component where have a point like an input with x,y,z values, to generate a new point  in other location... with the input point like the origin..., something like the pic 

Attachments:

Hi Leonel, have you seen the Point Oriented component?
(In Vector > Point tab)

i don't see it..., it's the same thing that i recent finish :(... hahah. thx Pieter i will try to see the other components the next time!

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service