Grasshopper

algorithmic modeling for Rhino

Hi guys,

 

I'm working on an L-system script.

Currently I have a Point from Rhino which inputs into the VB component,

 

 

I have a Function procedure in the coding in which I'd like to use the Point input to calculate distance between the Point and start points of curves generated by the script.

 

I've declared "P" as New3dPoint, however I dont think it stores the Point from the input,

Does anyone knows the syntax for assigning the input Point to "P"?

 

help would be greatly appreciated, thanks in advance.

 

Views: 1271

Replies to This Discussion

I'm pretty sure it would be this:
dim pt as On3dPoint = P
(assuming your input point is named "P")

But you might be able to just delete the declaration, since you can already use the variable "P" to access the input point. It should be assigned automatically.
I've given them a try, but the input doesn't seem to be able to be accessed from Function procedure,

My script has a RUNSCRIPT component, which uses the FUNCTION procedure to evaluate the curves.
I've found out that the inputs can only be assessed directly from in RUNSCRIPT,(already assigned automatically and does not need declaration), but FUNCTION does not store the input, is there any possible way of getting the inputs into the function procedure???
If you upload your script, I'll take a look at it.
thanks benjamin
Attachments:
It seems like you just need to pass a point variable into your functions.
Currently, the functions already receive many arguments.
you just need to add one.
In the first line of the function, where it says:
Function addCurves(ByRef LIST As dataTree(Of onCurve), ... , ... )
you need to add a way to pass the variable into the function:
Function addCurves(ByRef Pt As On3dPoint, ByRef LIST As ... , ... )
then you can use Pt (or any other variable name you put there) inside of your function.

Back in the "RunScript" function, you then need to pass the point into the function when you call it:
addCurves(P, crvTree, aCrv, count, i, j, k, typeTree, 0)

I think this should solve your problem.
Hey it works. Thanks,

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service