8

I have created MyBlocks but want to change the input parameter to negative. Is this possible or must all the MyBlocks be re-written?

5 Answers 5

5

It is possible now (since version 1.3.0) by pressing the button at the upper left corner of the block:

enter image description here

0
4

It is not possible to modify the properties of myBlock in the current version of EV3 SW.

It is possible by tampering the block source files:

  1. create a copy of your *.ev3. Just in case
  2. rename *.ev3 to *.zip
  3. extract all files from the zip
  4. edit files as needed
  5. move changed files back into zip (Under Windows drag and drop to zip)
  6. rename *.zip to *.ev3

I successfully used this to change the icons for MyBlocks. Icons file should be here: C:\Program Files (x86)\LEGO Software\LEGO MINDSTORMS EV3 Home Edition\Resources\MyBlocks\images If you change the parameters, you will have to change all programs that use the MyBlock because the definition has changed.

I have tried it with success, having a backup is a must, you can easily corrupt your project files. I was able to modify the icon of parameter or myblock, rename the parameter, change the order of parameters, change the default values, add a new parameter. It is also possible to change the parameter type or delete the parameter, the lab sw removes existing wires correctly.

I would not tamper the files for some simple block, but for more complex block it could be worth. Let's hope some sw update will provide this function later, if it could be done manually, i see no reason why it is not implemented.

1

If you need to change something that is setup in the "My Block Builder" dialog box like the default value or min and max values for a slider, then yes, you need to create a new My Block. This is easy though. Just select everything in the existing My Block except for the Input Parameter block, the Output Parameter block and the Start block and then select Tools > My Block Builder to create a new (identical) block.

Another option would be to add a Math block inside of your My Block that multiplies the input parameter by -1 to make it negative.

1

If only we knew the developers' thoughts perhaps they intentionally made it hard to change MyBlocks in order to support some programming paradigm for kids (according to their opinion).

What I do is:

  1. Always put the variables into the block while their values come from outside constants. Never cross commands boundaries with wires. Put all the variables inside the block, next to their use, no matter how many times you use them. The order of the block's wires is usually the order of their first use inside the block.
  2. Make a copy of the program you want to routine
  3. Make a block of the copy:
    • Give the block a very clear name
    • Put no effort in any other features until you test the block to work 100%.
  4. For the final block version: just create it anew while still retaining the original commands, in a different file.
0

I know it is few years late but I just looked for this and then found an alternative/workaround. There is no way to edit a custom block, but one can select all of it (except inputs and outputs) and create a brand new block from it, then delete the original.

Too bad there is no direct way for this.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.