Copy configure events

Is there an easy way to copy and paste configured events?

Is there a way to copy and paste it that isn't easy?

Or do I have to manually generate each one for each that I need to make?

No there's no easy way to copy the Events of a component. Why not just copy the whole component and then change what you need to change in the props?

The hard way is to

  1. Copy the original component to your clipboard.
  2. Paste it into a text editor.
  3. Copy the target component to your clipboard.
  4. Paste it to another file in your text editor.
  5. Copy the events entry from the original component's JSON.
  6. Paste the contents of the clipboard into the appropriate location on the target component in the text editor (along with a preceding comma to make the JSON Gods happy).
  7. Copy the entirety of the target component in the text editor.
  8. Replace the target component in your Designer with the contents of your clipboard.
1 Like

This feels like a relatively easy enough “Copy event” or “Copy action” context menu on text lists in the popup. Similar to the “Copy binding” context menu.

2 Likes

In actual projects, it is very common to generate scripts for configured bindings.
At first you create thousands components to show the machine. Then, you realize you need script to control them....

1 Like

It seems the somewhat less hard way is to

  1. open the event script of the source object
  2. copy the script
  3. open the event script of the target object
  4. paste the script

but it does feel like a copy event script feature could save some time when you set it up like nideyijuyidong mentioned, even once you're experienced sometimes you end up doing t that way

And, I just discovered you can paste the script to muliple objects, so:

  1. open the event script of the source object
  2. copy the script
  3. select multiple objects you want to copy the script to
  4. make an event script of the target object(s)
  5. paste the script

This works best when the script is only self-referential to the object, but may work under other circumstances,