Select and Change Entities Example (JavaScript)

This example shows how to:
  • construct several Splines, which are displayed as the Dassault Systèmes logo in a DraftSight drawing.
  • select the Splines as a group of entities and modify the color of one member of that group of entities.
  1. Start DraftSight.
  2. Using the following form, click Create logo and watch the lower-left corner of the drawing.

    The Dassault Systèmes logo is created at the origin. The letter D changes from blue to yellow.

NOTE: 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. Start DraftSight.
  5. If using Windows Internet Explorer:
    1. Click the Information bar near the top of the webpage, select Allow Blocked Content if running scripts is blocked, and click Yes.
    2. To more easily examine the logo before and after changing the color of the letter D in the logo:
      1. Press F12 to open the Windows Internet Explorer Developer Tools.
        1. Select the Script tab.
        2. Locate and click var mSelectionManager = mDoc.GetSelectionManager(); to insert a breakpoint at that line.
        3. Click Start Debugging.
        4. Click OK to refresh the webpage.
      2. Click Create logo in the form in the webpage.
      3. Examine the logo in the drawing. The letter D is blue, the letter S is yellow, and the non-letter is red.
      4. Click Stop Debugging in Windows Internet Explorer Developer Tools.
      5. Examine the logo in the drawing. The letter D changed from blue to yellow.
      6. Click File > Exit to close Windows Internet Explorer Developer Tools.
  6. If using a web browser other than Windows Internet Explorer, click Create logo.

     

 
 

Output