Prompt for Block Insertion Example (JavaScript)

This example shows how to prompt a user for the insertion point and scale factors when inserting a Block instance.

To insert a Block instance:

  1. Start DraftSight and open a drawing.
  2. To use the default values shown in the form:
    1. Click Insert Block.
    2. Click in the graphics area where you want to insert the Block Instance.
    3. Press the Enter key at each prompt in the command window, which indicates to use the default value.
  3. To change the default values shown in the form, type a value for the default:
    1. X scale factor in Default X Scale.
    2. Y scale factor in Default Y Scale.
    3. Z scale factor in Default Z Scale.
    4. Click Insert Block.
    5. Click in the graphics area where you want to insert the Block instance.
    6. Press the Enter key at each prompt in the command window, which indicates to use the default value.
  4. To specify your own values:
    1. Click Insert Block on the form.
    2. Click in the graphics area to set the Block instance's insertion point.
    3. Move the pointer and click in the graphics area again to set the Block instance's scale factors.
      - or -
      Type a value for the X, Y, and Z scale factors when prompted at the command window.
  5. Examine the drawing.

NOTES:

  • Errors and the Block instance's scale factors are printed to Output.
  • To recreate this example:
  1. Right-click the topic and select to view the source.
  2. Save the file as an HTML file.
  3. Open the HTML file in your web browser.
  4. If using Windows Internet Explorer and running scripts is blocked, allow blocked content.

Default X Scale:    
Default Y Scale:    
Default Z Scale:    

Output