Hide Table of Contents

Sample Projects

The following sample projects are available to users of DraftSight who have network licenses.

 

Description Programming language Folder
 

Shows the creation and usage of combo boxes for four common
properties: color, line type, line width, and text style. Draws a text and its bounding box using the
specified properties.

 

Visual C#

 

C:\Program Files\Dassault Systemes\DraftSight\APISDK\samples\C#\Complex\PropertyControls

 

Creates a simple dock control in DraftSight. Allows you to
create a circle specifying radius and position.

 

Visual C#

 

C:\Program Files\Dassault Systemes\DraftSight\APISDK\samples\C#\Simple\DockControl

 

Demonstrates how to export drawing files (.dwg, .dxf) to
image files (.png). Opens a file browser asking the
user to specify the folder containing the drawings. Accepts the
folder and converts all drawings to Portable Network Graphics format.

 

Visual C#

 

C:\Program Files\Dassault Systemes\DraftSight\APISDK\samples\C#\Simple\DrawingToImage

 

Demonstrates how to create a ribbon-based user-interface.

 

Visual C#

 

C:\Program Files\Dassault Systemes\DraftSight\APISDK\samples\C#\Simple\Ribbon

 

Demonstrates how to create a context menu.

 

C++

 

C:\Program Files\Dassault Systemes\DraftSight\APISDK\samples\C++\Simple\ContextMenu

 

Demonstrates how to read and write extended data to entities and how to deal with custom data like xrecords and dictionaries.

 

C++

 

C:\Program Files\Dassault Systemes\DraftSight\APISDK\samples\C++\Simple\DictionaryXDataDemo

 

Demonstrates how to create a dock widget.

 

C++

 

C:\Program Files\Dassault Systemes\DraftSight\APISDK\samples\C++\Simple\DockWidget

 

Draws a circle.

 

C++

 

C:\Program Files\Dassault Systemes\DraftSight\APISDK\samples\C++\Simple\DrawCircleCommand

 

Runs the application in the background, opens the drawing, and exports the contents of the drawing to a Portable Network Graphics file. Requires DraftSight Premium.

 

C++

 

C:\Program Files\Dassault Systemes\DraftSight\APISDK\samples\C++\Simple\DrawingToImage

 

Demonstrates how to create a Bill of Materials using the table entity.

 

C++

 

C:\Program Files\Dassault Systemes\DraftSight\APISDK\samples\C++\Simple\DrawTableCommand

 

Demonstrates entity preview.

 

C++

 

C:\Program Files\Dassault Systemes\DraftSight\APISDK\samples\C++\Simple\EntityPreviewDemo

 

Creates a menu and a command.

 

C++

 

C:\Program Files\Dassault Systemes\DraftSight\APISDK\samples\C++\Simple\Menu

 

Demonstrates the minimum requirements for a DSAPI reactor. Catches document-based events and prompts the user with messages.

 

C++

 

C:\Program Files\Dassault Systemes\DraftSight\APISDK\samples\C++\Simple\Reactors

 

Demonstrates how to create a ribbon-based user-interface.

 

C++

 

C:\Program Files\Dassault Systemes\DraftSight\APISDK\samples\C++\Simple\Ribbon

 

Shows selection functionality and prints information about current and previous selection sets.

 

C++

 

C:\Program Files\Dassault Systemes\DraftSight\APISDK\samples\C++\Simple\Selection

 

Demonstrates how to create command trackers.

 

C++

 

C:\Program Files\Dassault Systemes\DraftSight\APISDK\samples\C++\Simple\TrackerDemo

 

Shows window usage and prints window size, position, etc.

 

C++

 

C:\Program Files\Dassault Systemes\DraftSight\APISDK\samples\C++\Simple\Windows

 

Demonstrates how to create and insert blocks and get and set custom data.

 

C++

 

C:\Program Files\Dassault Systemes\DraftSight\APISDK\samples\C++\Complex\BlockCustomData

 

Displays the blocks (.dwg files) in the folder %ALLUSERSPROFILE/Dassault/Systemes/-DraftSight/BlockLibraryRoot/ as a library and allows you to add the blocks to the drawing. Demonstrates a block library.

 

C++

 

C:\Program Files\Dassault Systemes\DraftSight\APISDK\samples\C++\Complex\BlockLibraryManager

 

Demonstrates how to create block trackers.

 

C++

 

C:\Program Files\Dassault Systemes\DraftSight\APISDK\samples\C++\Complex\BlockTrackerDemo

 

Demonstrates how to program Lisp functions. Requires DraftSight Premium.

 

C++

 

C:\Program Files\Dassault Systemes\DraftSight\APISDK\samples\C++\Complex\Lisp

 

Demonstrates how to post events.

 

C++

 

C:\Program Files\Dassault Systemes\DraftSight\APISDK\samples\C++\Complex\PostEvent

 

Demonstrates how to program property widgets.

 

C++

 

C:\Program Files\Dassault Systemes\DraftSight\APISDK\samples\C++\Complex\PropertyWidgets

 

Demonstrates how to create a part list.

 

C++ COM

 

C:\Program Files\Dassault Systemes\DraftSight\APISDK\samples\COM\Complex\PartList

 

Demonstrates how to create patterns.

 

C++ COM

 

C:\Program Files\Dassault Systemes\DraftSight\APISDK\samples\COM\Complex\PatternGenerator

 

Demonstrates how to create property controls.

 

C++ COM

 

C:\Program Files\Dassault Systemes\DraftSight\APISDK\samples\COM\Complex\PropertyControls

 

Demonstrates how to create a simple dock control.

 

C++ COM

 

C:\Program Files\Dassault Systemes\DraftSight\APISDK\samples\COM\Simple\DockControl

 

Demonstrates how to export drawing files (.dwg, .dxf) to image files (.png).

 

C++ COM

 

C:\Program Files\Dassault Systemes\DraftSight\APISDK\samples\COM\Simple\DrawingToImage

 

Demonstrates how to create a ribbon-based user-interface.

 

C++ COM

 

C:\Program Files\Dassault Systemes\DraftSight\APISDK\samples\COM\Simple\RibbonSample

 

Demonstrates how to create a serial resistor.

 

JavaScript

 

C:\Program Files\Dassault Systemes\DraftSight\APISDK\samples\JS\Complex\SerialResistor.html

 

Demonstrates how to create a ribbon-based user-interface.

 

JavaScript

 

C:\Program Files\Dassault Systemes\DraftSight\APISDK\samples\JS\Simple\RibbonSample.html

 

Demonstrates how to create MFC property controls.

 

MFC

 

C:\Program Files\Dassault Systemes\DraftSight\APISDK\samples\MFC\Complex\PropertyControlsMFC

 

Demonstrates how to create a simple dock control.

 

MFC

 

C:\Program Files\Dassault Systemes\DraftSight\APISDK\samples\MFC\Simple\DockControl

 

Demonstrates how to export drawing files (.dwg, .dxf) to image files (.png).

 

MFC

 

C:\Program Files\Dassault Systemes\DraftSight\APISDK\samples\MFC\Simple\DrawingToImage

 

Reads all blocks in the current drawing and writes their attributes to tables that can be exported to an Excel worksheet. Run this sample with DraftSight's sample drawing, C-89764.DWG. Requires Microsoft Excel.

 

VB.NET

 

C:\Program Files\Dassault Systemes\DraftSight\APISDK\samples\VB.Net\complex\BlockAttributeDemo

 

Using R = U / I, calculates the appropriate resistor to be used for a series of LEDs in a circuit of given current and voltage. Also connects all elements in the serial circuit.

 

VB.NET

 

C:\Program Files\Dassault Systemes\DraftSight\APISDK\samples\VB.Net\complex\SerialResistor

 

Inserts a simple note in a drawing.

 

VB.NET

 

C:\Program Files\Dassault Systemes\DraftSight\APISDK\samples\VB.Net\simple\MyPrint

 

Back to top



Provide feedback on this topic

SOLIDWORKS welcomes your feedback concerning the presentation, accuracy, and thoroughness of the documentation. Use the form below to send your comments and suggestions about this topic directly to our documentation team. The documentation team cannot answer technical support questions. Click here for information about technical support.

* Required

 
*Email:  
Subject:   Feedback on Help Topics
Page:   Sample Projects
*Comment:  
*   I acknowledge I have read and I hereby accept the privacy policy under which my Personal Data will be used by Dassault Systèmes

Print Topic

Select the scope of content to print:

x

We have detected you are using a browser version older than Internet Explorer 7. For optimized display, we suggest upgrading your browser to Internet Explorer 7 or newer.

 Never show this message again
x

Web Help Content Version: API Help (English only) 2019 SP05

To disable Web help from within SOLIDWORKS and use local help instead, click Help > Use SOLIDWORKS Web Help.

To report problems encountered with the Web help interface and search, contact your local support representative. To provide feedback on individual help topics, use the “Feedback on this topic” link on the individual topic page.