201x
004335
2023-07-26

FAQ 005398 | How can I create and save a block using JavaScript?

Question:
How can I create and save a block using JavaScript?

Answer:
To create and save a block with JavaScript, proceed as follows:

  1. Open the Dlubal Center | Blocks.
  2. Select any block that contains JavaScript.
  3. In the "Edit Blocks'" dialog box, switch to the "JavaScript" tab (Image 01).
  4. Click the ► Image | Open https://www.dlubal.com/en-US/img/027532 button to do your programming directly in the "JavaScript" tab. As an alternative, you can use the ► Image | Browse https://www.dlubal.com/en-US/img/042518 button to import a JavaScript file.
  5. Click the ► Image | Apply https://www.dlubal.com/en-US/img/029800 button to apply the JavaScript.
  6. Then, save the block by clicking the ► Image | Save Block https://www.dlubal.com/en-US/img/042519 button.
  7. In the "Save as Block" dialog box, enter the name of the block, and make the settings for the block categorization (Image 02).

► Image | Dialog Box "Edit Block", Tab "JavaScript" https://www.dlubal.com/en/img/042522

► Image | Dialog Box "Save as Block" https://www.dlubal.com/en/img/042520