[{"data":1,"prerenderedAt":106,"prefetchLinks":107},["ShallowReactive",2],{"article_building-applications-for-draftsight_draftsight":3,"_apollo:default":104,"_apollo:identified":105},{"posts":4},{"nodes":5,"__typename":103},[6],{"id":7,"slug":8,"title":9,"uri":10,"excerpt":11,"locale":12,"featuredImage":15,"tableOfContents":23,"content":24,"date":25,"authorJobTitle":26,"author":27,"masterings":37,"globalTags":41,"products":48,"disciplines":60,"seo":92,"__typename":102},"cG9zdDo1ODczMQ==","building-applications-for-draftsight","Building Applications for DraftSight","\u002Fproducts\u002Fdraftsight\u002Fbuilding-applications-for-draftsight","\u003Cp>We’re going to step away from the Customer Stories just for the…\u003C\u002Fp>\n",{"locale":13,"__typename":14},"en_US","Locale",{"node":16,"__typename":22},{"large":17,"__typename":18,"medium_large":17,"thumbnail":19,"srcSet":20,"sizes":21},"https:\u002F\u002Fblog-assets.solidworks.com\u002Fuploads\u002F2025\u002F12\u002Fapicover3.png.webp","MediaItem","https:\u002F\u002Fblog-assets.solidworks.com\u002Fuploads\u002F2025\u002F12\u002Fapicover3-150x150.png.webp","https:\u002F\u002Fblog-assets.solidworks.com\u002Fuploads\u002F2025\u002F12\u002Fapicover3.png.webp 600w, https:\u002F\u002Fblog-assets.solidworks.com\u002Fuploads\u002F2025\u002F12\u002Fapicover3-300x172.png.webp 300w","(max-width: 600px) 100vw, 600px","NodeWithFeaturedImageToMediaItemConnectionEdge",[],"\u003Cp class=\"wp-block-paragraph\">We’re going to step away from the Customer Stories just for the moment and get tech heavy.  Today’s blog, as you can guess from the title, deals with building applications for DraftSight.  So, why exactly might you want to build an application for DraftSight? Well, DraftSight customers are constantly looking for ways to improve their efficiency while working with it. How? Well, I give some examples below:\u003C\u002Fp>\u003Col class=\"wp-block-list\">\n\u003Cli>Customers need to automate their work flow.\u003C\u002Fli>\n\u003Cli>Customers work with other systems (ERP, PDM, databases, etc…) and need to integrate DraftSight into those work flows\u003C\u002Fli>\n\u003Cli>Customers have migrated from other CAD applications, where they have some add-ins working which no longer work in DraftSight.\u003C\u002Fli>\n\u003C\u002Fol>\u003Cp class=\"wp-block-paragraph\">In addition to this, DraftSight Partners, Resellers and Service Providers also like to develop add-ins to improve the DraftSight experience for their users. How do they do all this?  They use the DraftSight API. What is the DraftSight API? Well, let me explain.\u003C\u002Fp>\u003Cp class=\"wp-block-paragraph\">High Level Solution\u003C\u002Fp>\u003Cp class=\"wp-block-paragraph\">DraftSight API is a set of methods and interfaces available for users to customise DraftSight to automate their workflow and interact with all the elements which make up DraftSight (UI, drawings, etc…). It allows customers and partners to develop powerful add-ins which seamlessly work with DraftSight and make use of the same core elements with which DraftSight is built. It provides templates through which developers can write add-ins fairly quickly, a set of examples which teach how the API can be used to automate some common work flows and documentation which contains plenty of code snippets that can be used directly in the application.\u003C\u002Fp>\u003Cp class=\"wp-block-paragraph\">DraftSight API is available for developers to write applications in the following languages.\u003C\u002Fp>\u003Cul class=\"wp-block-list\">\n\u003Cli>C++\u003C\u002Fli>\n\u003Cli>C++ COM\u003C\u002Fli>\n\u003Cli>C#\u003C\u002Fli>\n\u003Cli>VB.NET\u003C\u002Fli>\n\u003Cli>JavaScript\u003C\u002Fli>\n\u003Cli>LISP\u003C\u002Fli>\n\u003C\u002Ful>\u003Cp class=\"wp-block-paragraph\">The API interfaces are consistent across all the languages we support and are forward compatible.\u003C\u002Fp>\u003Cp class=\"wp-block-paragraph\">Developers can develop either external applications which automate a repetitive task (e.g., A VB.NET application which batch prints a bunch of documents at a scheduled time every day) or develop add-ins where they integrate an external application into their work flow (e.g., integrate EPDM or SAP). In the second case, the DraftSight UI is fully accessible so users can add menus, toolbars, dockable windows and so on, so that the add-in would look like a native DraftSight feature. All the entities in the drawing are available through the API so developers can query, update and run rich modifications to the entities.\u003C\u002Fp>\u003Cp class=\"wp-block-paragraph\">The C++ and .NET add-ins can be developed using Visual Studio 2008 and above. To assist developers in getting started, DraftSight provides templates for Visual studio through which a lot of boiler plate code is pre-generated to connect the add-in to DraftSight. Users can then focus on writing code relevant to their workflow rather than spending time in writing this connection. \u003C\u002Fp>\u003Cp class=\"wp-block-paragraph\">AutoLISP can be loaded directly inside DraftSight and run. Visual Lisp support is on the product future plan. \u003C\u002Fp>\u003Cp class=\"wp-block-paragraph\">Existing add-ins from other CAD applications need to be re-written in DraftSight API. \u003C\u002Fp>\u003Cp class=\"wp-block-paragraph\">Another quick way to develop add-ins is through the Macro feature. Users can record their operations in any of the supported languages. Users can either build add-ins to replay those sequences, or use Macros as a start to automate more sophisticated workflows.\u003C\u002Fp>\u003Cp class=\"wp-block-paragraph\">In addition to standard programming languages like C++, C# and VB.NET, developers can write add-ins using JavaScript and HTML. This way, developers can build compelling web pages to connect to the data available in drawings. For example, users can build a web page using JavaScript to query the rooms on a floor plan and generate reports out of it.\u003C\u002Fp>\u003Cdiv class=\"wp-block-image\">\u003Cfigure class=\"size-large thumbnail wp-caption aligncenter\">\u003Cimg loading=\"lazy\" decoding=\"async\" width=\"591\" height=\"650\" src=\"https:\u002F\u002Fblog-assets.solidworks.com\u002Fuploads\u002F2025\u002F12\u002Fapi1-591x650-1.png.webp\" alt=\"\" class=\"wp-image-58733\" srcset=\"https:\u002F\u002Fblog-assets.solidworks.com\u002Fuploads\u002F2025\u002F12\u002Fapi1-591x650-1.png.webp 591w, https:\u002F\u002Fblog-assets.solidworks.com\u002Fuploads\u002F2025\u002F12\u002Fapi1-591x650-1-273x300.png.webp 273w\" sizes=\"auto, (max-width: 591px) 100vw, 591px\" \u002F>\u003Cfigcaption>The DraftSight API High Level Hierarchy\u003C\u002Ffigcaption>\u003C\u002Ffigure>\u003C\u002Fdiv>\u003Cp class=\"wp-block-paragraph\">The following graphic displays some of the interfaces and event enumerations available with the API. The entire list is available in the API documentation:\u003C\u002Fp>\u003Cfigure class=\"wp-block-image size-large\">\u003Cimg loading=\"lazy\" decoding=\"async\" width=\"650\" height=\"418\" src=\"https:\u002F\u002Fblog-assets.solidworks.com\u002Fuploads\u002F2025\u002F12\u002Fapi4-650x418-1.png.webp\" alt=\"\" class=\"wp-image-58734\" srcset=\"https:\u002F\u002Fblog-assets.solidworks.com\u002Fuploads\u002F2025\u002F12\u002Fapi4-650x418-1.png.webp 650w, https:\u002F\u002Fblog-assets.solidworks.com\u002Fuploads\u002F2025\u002F12\u002Fapi4-650x418-1-300x193.png.webp 300w\" sizes=\"auto, (max-width: 650px) 100vw, 650px\" \u002F>\u003C\u002Ffigure>\u003Cp class=\"wp-block-paragraph\">Developers can choose to develop an application either using scripting in\u003C\u002Fp>\u003Cul class=\"wp-block-list\">\n\u003Cli>VBA\u003C\u002Fli>\n\u003Cli>JavaScript\u003C\u002Fli>\n\u003C\u002Ful>\u003Cp class=\"wp-block-paragraph\">Or compiled languages in:\u003C\u002Fp>\u003Cul class=\"wp-block-list\">\n\u003Cli>VB\u002FC#.NET\u003C\u002Fli>\n\u003Cli>C++ COM\u003C\u002Fli>\n\u003Cli>C++\u003C\u002Fli>\n\u003C\u002Ful>\u003Cp class=\"wp-block-paragraph\">Rapid Application Development Using DraftSight Add-in Templates\u003C\u002Fp>\u003Cp class=\"wp-block-paragraph\">To assist developers to build new add-ins or migrate their existing customisation from other applications, DraftSight installer ships pre-built templates for Visual Studio. These templates are available for the programming languages that DraftSight supports, C++, C# and VB.Net. For C++, DraftSight provides templates for both COM and native C++ add-ins. Please refer to image below that shows the template for C#:\u003C\u002Fp>\u003Cfigure class=\"wp-block-image size-large\">\u003Cimg loading=\"lazy\" decoding=\"async\" width=\"650\" height=\"329\" src=\"https:\u002F\u002Fblog-assets.solidworks.com\u002Fuploads\u002F2025\u002F12\u002Fapi5-650x329-1.png.webp\" alt=\"\" class=\"wp-image-58735\" srcset=\"https:\u002F\u002Fblog-assets.solidworks.com\u002Fuploads\u002F2025\u002F12\u002Fapi5-650x329-1.png.webp 650w, https:\u002F\u002Fblog-assets.solidworks.com\u002Fuploads\u002F2025\u002F12\u002Fapi5-650x329-1-300x152.png.webp 300w\" sizes=\"auto, (max-width: 650px) 100vw, 650px\" \u002F>\u003C\u002Ffigure>\u003Cp class=\"wp-block-paragraph\">These templates automatically generate all the boiler-plate code required for an add-in to be loaded inside DraftSight. Please see image below:\u003C\u002Fp>\u003Cfigure class=\"wp-block-image size-large\">\u003Cimg loading=\"lazy\" decoding=\"async\" width=\"650\" height=\"254\" src=\"https:\u002F\u002Fblog-assets.solidworks.com\u002Fuploads\u002F2025\u002F12\u002Fapi6-650x254-1.png.webp\" alt=\"\" class=\"wp-image-58736\" srcset=\"https:\u002F\u002Fblog-assets.solidworks.com\u002Fuploads\u002F2025\u002F12\u002Fapi6-650x254-1.png.webp 650w, https:\u002F\u002Fblog-assets.solidworks.com\u002Fuploads\u002F2025\u002F12\u002Fapi6-650x254-1-300x117.png.webp 300w\" sizes=\"auto, (max-width: 650px) 100vw, 650px\" \u002F>\u003C\u002Ffigure>\u003Cp class=\"wp-block-paragraph\">In addition, the auto generated code includes all the code, along with toolbars, that is required to execute a sample command that developers can use as a starting point to either extend or implement sophisticated additional customisation. Please see image below:\u003C\u002Fp>\u003Cfigure class=\"wp-block-image size-large\">\u003Cimg loading=\"lazy\" decoding=\"async\" width=\"650\" height=\"251\" src=\"https:\u002F\u002Fblog-assets.solidworks.com\u002Fuploads\u002F2025\u002F12\u002Fapi7-650x251-1.png.webp\" alt=\"\" class=\"wp-image-58737\" srcset=\"https:\u002F\u002Fblog-assets.solidworks.com\u002Fuploads\u002F2025\u002F12\u002Fapi7-650x251-1.png.webp 650w, https:\u002F\u002Fblog-assets.solidworks.com\u002Fuploads\u002F2025\u002F12\u002Fapi7-650x251-1-300x116.png.webp 300w\" sizes=\"auto, (max-width: 650px) 100vw, 650px\" \u002F>\u003C\u002Ffigure>\u003Cp class=\"wp-block-paragraph\">The benefit to developers is that without writing a line of code, you have a working add-in to load inside DraftSight. All that developers needs to do is to add your changes to implement specific commands, compile the code and load the resulting output DLL in DraftSight using the “Load Application” button available on the ribbon. Please see image below:\u003C\u002Fp>\u003Cfigure class=\"wp-block-image size-large\">\u003Cimg loading=\"lazy\" decoding=\"async\" width=\"650\" height=\"336\" src=\"https:\u002F\u002Fblog-assets.solidworks.com\u002Fuploads\u002F2025\u002F12\u002Fapi8-650x336-1.png.webp\" alt=\"\" class=\"wp-image-58738\" srcset=\"https:\u002F\u002Fblog-assets.solidworks.com\u002Fuploads\u002F2025\u002F12\u002Fapi8-650x336-1.png.webp 650w, https:\u002F\u002Fblog-assets.solidworks.com\u002Fuploads\u002F2025\u002F12\u002Fapi8-650x336-1-300x155.png.webp 300w\" sizes=\"auto, (max-width: 650px) 100vw, 650px\" \u002F>\u003C\u002Ffigure>\u003Cp class=\"wp-block-paragraph\">After loading the add-in, for the above sample project, the user can now see the toolbar with the button for the sample command. Please see image below. \u003C\u002Fp>\u003Cfigure class=\"wp-block-image size-large\">\u003Cimg loading=\"lazy\" decoding=\"async\" width=\"650\" height=\"294\" src=\"https:\u002F\u002Fblog-assets.solidworks.com\u002Fuploads\u002F2025\u002F12\u002Fapi9-650x294-1.png.webp\" alt=\"\" class=\"wp-image-58739\" srcset=\"https:\u002F\u002Fblog-assets.solidworks.com\u002Fuploads\u002F2025\u002F12\u002Fapi9-650x294-1.png.webp 650w, https:\u002F\u002Fblog-assets.solidworks.com\u002Fuploads\u002F2025\u002F12\u002Fapi9-650x294-1-300x136.png.webp 300w\" sizes=\"auto, (max-width: 650px) 100vw, 650px\" \u002F>\u003C\u002Ffigure>\u003Cp class=\"wp-block-paragraph\">Summary\u003C\u002Fp>\u003Cp class=\"wp-block-paragraph\">To summarise, DraftSight API is a powerful SDK available for users to automate manual operations and to integrate DraftSight into the existing work flow. It supports both modern and legacy languages and comes with documentation and tools for rapid development. The breadth of the API is wide so users have everything needed to migrate existing add-ins from other applications to DraftSight.\u003C\u002Fp>\u003Cp class=\"wp-block-paragraph\">And that is an introduction to the DraftSight API SDK and Building Applications for DraftSight.  I told you it was going to get a bit tech heavy!  If you are an Enterprise, Premium or a Professional user, why not try the SDK for yourself and see what time saving tools you can develop!\u003C\u002Fp>\u003Cp class=\"wp-block-paragraph\">Learn more about DraftSight and how to start a free 30-day trial \u003Ca href=\"https:\u002F\u002Fwww.draftsight.com\u002F?utm_medium=Display&#038;utm_source=Blog&#038;utm_campaign=DraftSight_Blog&#038;utm_content=Learn_More_DS2020_&#038;utm_term=link-text\" target=\"_blank\" rel=\"noopener noreferrer\">here\u003C\u002Fa>.\u003C\u002Fp>","2020-08-31T10:37:00","",{"node":28,"__typename":36},{"nicename":29,"description":30,"slug":29,"name":31,"firstName":31,"lastName":26,"avatar":32,"__typename":35},"draftsight","DraftSight is a professional-grade 2D CAD product that allows you to access existing DWG files and create new ones at fraction of the cost of alternative CAD products.","DraftSight",{"url":33,"__typename":34},"https:\u002F\u002Fblog-assets.solidworks.com\u002Fuploads\u002F2025\u002F12\u002Fdraftsight-avatar.jpg-96x96.webp","Avatar","User","NodeWithAuthorToUserConnectionEdge",{"nodes":38,"edges":39,"__typename":40},[],[],"PostToTaxonomy_masteringConnection",{"nodes":42,"__typename":47},[43],{"id":44,"name":31,"slug":29,"uri":45,"__typename":46},"dGVybTo5NTk1","\u002Ftags\u002Fdraftsight\u002F","Taxonomy_tag","PostToTaxonomy_tagConnection",{"edges":49,"nodes":57,"__typename":59},[50],{"isPrimary":51,"node":52,"__typename":56},false,{"id":53,"name":31,"slug":29,"uri":54,"__typename":55},"dGVybTo1NQ==","\u002Fproducts\u002Fdraftsight\u002F","Taxonomy_product","PostToTaxonomy_productConnectionEdge",[58],{"id":53,"name":31,"slug":29,"uri":54,"__typename":55},"PostToTaxonomy_productConnection",{"nodes":61,"edges":85,"__typename":91},[62,76],{"id":63,"name":64,"slug":65,"uri":66,"parentId":67,"disciplines":68,"__typename":75},"dGVybTo1OQ==","2D CAD","2d-cad","\u002Fdisciplines\u002F2d-cad\u002F","dGVybTo1OA==",{"nodes":69,"__typename":74},[70],{"title":64,"uri":71,"parentId":72,"__typename":73},"\u002Fdisciplines\u002Fdesign-engineering\u002F2d-cad","cG9zdDozNzcz","Discipline","Taxonomy_disciplineToDisciplineConnection","Taxonomy_discipline",{"id":67,"name":77,"slug":78,"uri":79,"parentId":80,"disciplines":81,"__typename":75},"Design and Engineering","design-engineering","\u002Fdisciplines\u002Fdesign-engineering\u002F",null,{"nodes":82,"__typename":74},[83],{"title":77,"uri":84,"parentId":80,"__typename":73},"\u002Fdisciplines\u002Fdesign-engineering",[86,89],{"isPrimary":51,"node":87,"__typename":88},{"parentId":67,"id":63,"name":64,"slug":65,"uri":66,"__typename":75},"PostToTaxonomy_disciplineConnectionEdge",{"isPrimary":51,"node":90,"__typename":88},{"parentId":80,"id":67,"name":77,"slug":78,"uri":79,"__typename":75},"PostToTaxonomy_disciplineConnection",{"canonical":93,"title":94,"metaDesc":26,"opengraphAuthor":26,"opengraphDescription":95,"opengraphTitle":9,"opengraphUrl":93,"opengraphSiteName":96,"opengraphPublishedTime":97,"opengraphModifiedTime":98,"twitterTitle":26,"twitterDescription":26,"readingTime":99,"metaRobotsNoindex":100,"__typename":101},"https:\u002F\u002Fblog-contrib-prd.itvpc.solidworks.com\u002Fproducts\u002Fdraftsight\u002Fbuilding-applications-for-draftsight\u002F","Building Applications for DraftSight - Blog Solidworks","We’re going to step away from the Customer Stories just for the…","Blog Solidworks","2020-08-31T14:37:00+00:00","2026-02-12T20:16:32+00:00",5,"index","PostTypeSEO","Post","RootQueryToPostConnection",{},{},1796106584417,[108,114,116,118,120,123],{"rel":109,"href":110,"as":111,"type":112,"crossorigin":113},"preload","https:\u002F\u002Fwww.3ds.com\u002Fstatics\u002Ffonts\u002F3ds\u002F3ds-Light-v2.woff2","font","font\u002Fwoff2","anonymous",{"rel":109,"href":115,"as":111,"type":112,"crossorigin":113},"https:\u002F\u002Fwww.3ds.com\u002Fstatics\u002Ffonts\u002F3ds\u002F3ds-Regular-v2.woff2",{"rel":109,"href":117,"as":111,"type":112,"crossorigin":113},"https:\u002F\u002Fwww.3ds.com\u002Fstatics\u002Ffonts\u002F3ds\u002F3ds-SemiBold-v2.woff2",{"rel":109,"href":119,"as":111,"type":112,"crossorigin":113},"https:\u002F\u002Fwww.3ds.com\u002Fstatics\u002Ffonts\u002F3ds\u002F3ds-Bold-v2.woff2",{"rel":109,"href":121,"as":122},"https:\u002F\u002Fwww.3ds.com\u002Fstatics\u002F3ds-navigation\u002Fds-header.min.js","script",{"rel":109,"href":124,"as":122},"https:\u002F\u002Fwww.3ds.com\u002Fstatics\u002F3ds-navigation\u002Fds-footer.min.js"]