Annex

In this annexe we look at the file format and other technical stuff.

File format

The EV3 Classroom application stores projects with a .lmsp extension. You can remember this as LEGO MINDSTORMS Scratch Program.

When you create your first project, it is called Project 1.lmsp

The file inspector shows:

  • Type: EV3 Project Archive
  • Size: 40 985 bytes (41 KB)

Open the .lmsp file

The Project 1.lmsp is in fact a ZIP file. You can:

  • make a copy of it,
  • change the extension from .lmsp to .zip
  • decompress the ZIP file

You will get a Project 1 folder with 3 files:

  • icon.svg
  • manifest.jsn
  • scratch.sb3

The icon.svg file

This file contains an image of the program, probably to be displayed in Home > Recent projects.

../_images/icon.svg

The manifest.jsn file

This file contains information about the connection, zoom level, position, etc.

{
    "autoDelete": true,
    "created": "2020-02-07T15:58:32.427Z",
    "hardware": {
        "=h{q!08=bSKjnG!;0#eZ": {
            "address": "IOService:/AppleACPIPlatformExpert/PCI0@0/AppleACPIPCI/XHC1@14/XHC1@14000000/PRT2@14200000/EV3@14200000/Xfer data to and from EV3 brick@0/AppleUserUSBHostHIDDevice",
            "description": "",
            "connection": "usb-hid",
            "name": "EV3",
            "type": "ev3",
            "serial": "0016533d0a6c",
            "hubState": {
                "programRunning": false
            },
            "lastConnectedSerial": "0016533d0a6c"
        }
    },
    "id": "lKDY_8BjjFjI",
    "lastsaved": "2020-04-11T16:00:46.620Z",
    "size": 0,
    "name": "Project 1",
    "slotIndex": 0,
    "showAllBlocks": false,
    "state": {
        "playMode": "download",
        "canvasDrawerTab": "monitorTab"
    },
    "version": 1,
    "zoomLevel": 0.8250000000000002,
    "workspaceX": 120.00000000000034,
    "workspaceY": 220.00000000000006,
    "extensions": [
        "ev3events",
        "ev3display"
    ]
}

The scratch.sb3 file

This is a SB3 file, based on the MIT Scratch 3.0 format.

You can again:

  • replace the .sb3 extension with .zip
  • decompress the archive

You will get a folder called scratch which contains:

  • svg file
  • wav file (Meow)
  • png file
  • project.json file

This JSON file contains:

{
    "targets": [
        {
            "isStage": true,
            "name": "Stage",
            "variables": {},
            "lists": {},
            "broadcasts": {},
            "blocks": {},
            "comments": {},
            "currentCostume": 0,
            "costumes": [
                {
                    "assetId": "14d134f088239ac481523b3c2c6ecd8c",
                    "name": "backdrop1",
                    "bitmapResolution": 1,
                    "md5ext": "14d134f088239ac481523b3c2c6ecd8c.svg",
                    "dataFormat": "svg",
                    "rotationCenterX": 47,
                    "rotationCenterY": 55
                }
            ],
            "sounds": [
                {
                    "assetId": "83c36d806dc92327b9e7049a565c6bff",
                    "name": "Meow",
                    "dataFormat": "wav",
                    "format": "",
                    "rate": 44100,
                    "sampleCount": 37376,
                    "md5ext": "83c36d806dc92327b9e7049a565c6bff.wav"
                }
            ],
            "volume": 0,
            "tempo": 60,
            "videoTransparency": 50,
            "videoState": "on",
            "textToSpeechLanguage": null
        },
        {
            "isStage": false,
            "name": "7OQe8zk4TyyTWFib4vkW",
            "variables": {},
            "lists": {},
            "broadcasts": {},
            "blocks": {
                "xYhpfMLy1ynSQzb93O1W": {
                    "opcode": "ev3events_whenProgramStarts",
                    "next": "]}sBQp1+Wg:TSU[;Qw?S",
                    "parent": null,
                    "inputs": {},
                    "fields": {},
                    "shadow": false,
                    "topLevel": true,
                    "x": 34,
                    "y": -19
                },
                "]}sBQp1+Wg:TSU[;Qw?S": {
                    "opcode": "ev3display_displayImageForTime",
                    "next": null,
                    "parent": "xYhpfMLy1ynSQzb93O1W",
                    "inputs": {
                        "DURATION": [
                            1,
                            [
                                4,
                                "2"
                            ]
                        ]
                    },
                    "fields": {
                        "IMAGE": [
                            "Neutral",
                            null
                        ]
                    },
                    "shadow": false,
                    "topLevel": false
                }
            },
            "comments": {},
            "currentCostume": 0,
            "costumes": [
                {
                    "assetId": "93ca32a536da1698ea979f183679af29",
                    "name": "8my-jkz-3zNRywbMFwa-",
                    "bitmapResolution": 1,
                    "md5ext": "93ca32a536da1698ea979f183679af29.png",
                    "dataFormat": "png",
                    "rotationCenterX": 240,
                    "rotationCenterY": 180
                }
            ],
            "sounds": [
                {
                    "assetId": "83c36d806dc92327b9e7049a565c6bff",
                    "name": "Meow",
                    "dataFormat": "wav",
                    "format": "",
                    "rate": 44100,
                    "sampleCount": 37376,
                    "md5ext": "83c36d806dc92327b9e7049a565c6bff.wav"
                }
            ],
            "volume": 100,
            "visible": true,
            "x": 0,
            "y": 0,
            "size": 100,
            "direction": 90,
            "draggable": false,
            "rotationStyle": "all around"
        }
    ],
    "monitors": [],
    "extensions": [
        "ev3events",
        "ev3display"
    ],
    "meta": {
        "semver": "3.0.0",
        "vm": "0.2.0-prerelease.20190619042313",
        "agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_4) AppleWebKit/537.36 (KHTML, like Gecko) EV3Classroom/1.0.0 Chrome/69.0.3497.106 Electron/4.0.4 Safari/537.36"
    }
}