visose / Robots

Create and simulate ABB, KUKA, UR, and Staubli robot programs.
MIT License
301 stars 125 forks source link

Customizing a line in a program #50

Closed gkirdeikis closed 3 years ago

gkirdeikis commented 3 years ago

Hi there,

Since we have quite a few modules that are constantly loaded into our ABB robot PROC Main() command always complains and I need to get into it and manually change Main to something like MyCustomMain() . I was wondering if it's possible to do that in Grasshopper somewhere between Create Program and Save Program components. TL;DR - is it possible to "unpack" the program, change it and then "package" it for the SaveProgram component?

visose commented 3 years ago

Hi, yes. You can modify the code output of the Create Program component with standard grasshopper components, like using the Replace Text component to replace Main() with MyCustomMain(). Then connect this code and the Program output to the Custom Code component, and from this to the Save Program component.

gkirdeikis commented 3 years ago

Understood, thank you for the swift response!