I have a kind of “layer machine” done with Human for a thesis project, that it has a lot of layers and sublayers.
What I’m doing first is to make all the layers and then bake my geometry. BUT, here’s the thing, i have to make 100 layers, so it’s kind of boring to being clicking over a over the slider, so is there a way to make the slider run by itself with a timer WITHOUT saving frames?
Why do you need a slider at all for creating layers? Instead of providing a single value, can’t you provide a list to make them all at once? It would help if you upload an example file.
@maje90 with interval i intended like, controlling every how many n seconds it moves. With the C# script that you did, there’s no option to decide that like in the first definition that you pictured.
and about @dharman question, because it’s linked with a excel file that structures the name of layers and sub layers. my model (an architectural project) is structured by steps because i have to show to my profesor how it is generated, step by step. they assign us this layers structure and here’s the best way i could find to generate them. every step has this group of sublayers and as you can see, they are a lot.
meanwhile in grasshopper, every step is divided by a square group, structured as “number imput”, “geometry imput”, “generation of the step”, “number output”, “geometry output”, “step to bake in color”, "step to bake in black (to show the generation)
i know haha. it’s complicated to explain, i tried my best! i’m the third person of my thesis group that tried to do this “bake&layer machine” for everyone to use.
the only thing that i can say is that if i generate every layer by once, my computer dies haha, cause they are hundreds of layers.
Thank you can i record the position? may be in ‘b’.
import Grasshopper as gh
import Rhino.Geometry as rg
def updateComponent(interval):
""" Update this component similar to using a grasshopper timer """
def callBack(e):
ghenv.Component.ExpireSolution(False)
ghenv.Component.OnPingDocument().ScheduleSolution(interval,
gh.Kernel.GH_Document.GH_ScheduleDelegate(callBack))
a = rg.Point3d(0,0,0)
# Instantiate or reset persistent counter variable
if "count" not in globals() or not Run:
count = 0
# Update the variable and component
if Run:
if count < Target:
count +=1
updateComponent(Interval)
elif count == Target:
count = 0
# Output counter
Counter = count
b = []
vector = rg.Vector3d(Counter,Counter,0)
a = a + vector
b.append(a)
thank you very much. Is it possible for me to know where I am doing the mistake.
import Grasshopper as gh
import Rhino.Geometry as rg
def updateComponent(interval):
""" Update this component similar to using a grasshopper timer """
def callBack(e):
ghenv.Component.ExpireSolution(False)
ghenv.Component.OnPingDocument().ScheduleSolution(interval,
gh.Kernel.GH_Document.GH_ScheduleDelegate(callBack))
a = rg.Point3d(0,0,0)
b = []
# Instantiate or reset persistent counter variable
if "count" not in globals() or not Run:
count = 0
# Update the variable and component
if Run:
if count < Target:
count +=1
vector = rg.Vector3d(count,count,0)
a = a + vector
b.append(a)
updateComponent(Interval)
elif count == Target:
count = 0
# Output counter
Counter = count
i want to append the updated positions to b. Thanks
I’m not on my computer, but have a look at the attached file here, it should get you going:
Edit: That might not actually be very helpful, but good fun though. Try moving the instantiation of the a and b variables here (i.e. which will make them persistent):
# Instantiate or reset persistent counter variable
if "count" not in globals() or not Run:
count = 0
a = rg.Point3d(0,0,0)
b = []