Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5

Creating Spray-trace using multiple colors

#1
Is it possible to create a trace with the Spray macro that includes particles of different colors?


So I want to have different colored particles on a surface at the same time, but all I was able to do is clearing the already existing Trace (which is for example contains red particles) and then start an other with a different color.

The script should be able to read the needed color from the station parameters while the main program is running, which I thought would be easy but even if it reads the color using RDK.getParam the color of the shapes do not change while running. Only if I stop the script, delete the trace and start it over.

Tried creating sub programs for each color but apparently those are using the exact same color that the first one did, also continuing the same Trace.

The outcome should look similar to this drawing example but with simpler, sphere-like particles.


Attached Files Thumbnail(s)

#2
Could you try something like this?https://youtu.be/sKJq-zarbo8
I know the trace is a bit hard to change color, I had my issues with this too.

Jeremy
Find useful information about RoboDK and its features by visiting ourOnline Documentationand by watching tutorials on ourYoutube Channel.


#3
Yep! WeldOn macro was the solution. It was enough to simply import that macro to the station then in the main Python script I called:
Code:
RDK.RunProgram('WeldOn(%s, %s, %s)'%('ON', 'Tool1', 'red'))

(Naturally you can replace 'red' with any color)
And when I wanted to turn the trace off:
Code:
RDK.RunProgram('WeldOn(%s, %s)'%('OFF', 'Tool1'))

Thanks for your help Jeremy!
#4
My pleasure
Find useful information about RoboDK and its features by visiting ourOnline Documentationand by watching tutorials on ourYoutube Channel.






Users browsing this thread:
1 Guest(s)