SpaTools: Construct Polylines / Polygons from Points in AutoCAD







It is often required to create a polyline or polygon from a set of points when working in CAD environment. The point data comes from the conventional terrestrial survey instruments like Total stations, GPS/GNSS equipment and other survey instruments. The data is then plotted in AutoCAD for cartographic purposes in the form of point objects.
These points are then connected by constructing polylines using polyline command in AutoCAD. This manual process to construct polylines is manual and time consuming.  

In this blog, I am going to share a custom tool developed using AutoCAD .Net API to automate the process of construction of polylines.  The .Net assembly (SpaTools.DLL file) can be downloaded via link provided at the end of this blog.
The assembly works well with AutoCAD 2013 and latest versions. To load the .Net Assembly follow these steps:
  • In  AutoCAD, at the Command prompt, enter netload and press Enter.
  • In the Choose .NET Assembly dialog box, browse to the assembly file (SpaTools.DLL). Click Open

Once loaded, there are two custom commands which can be used to construct polylines and polygons from points. It should be noted that the input points should be Points only. (No any other object).   

  1. CPL



Type CPL or cpl on command prompt. Select the points and press Enter (Right Click or Space). A polyline connecting the points will be constructed.


  2. CPG

Type CPG or cpg on command prompt. Select points and press Enter (Right Click or Space). A closed polyline will be constructed. 


The .Net Assembly can be downloaded  from Cadomation.

In case if netload shows the error as shown below,



Unblock the DLL first. Right Click on the DLL file and check the unblock checkbox and apply.

Restart AutoCAD application and use Netload to load the DLL again.











Download







Comments

  1. Cpl and cpg not working in conmand prompt......cpl goes for cplotsyle and cpg goes for copy command

    ReplyDelete
    Replies
    1. .Net assembly is not loaded. You need to unblock it. Read the link

      https://mywindowshub.com/how-to-unblock-a-file-in-windows-10/

      Delete
    2. The instructions to unblock the DLL are described in blog.

      Delete
  2. cpl and cpg commands run properly
    Thanks

    ReplyDelete
  3. Can you please share SpaTools.dll

    ReplyDelete

Post a Comment

Popular posts from this blog

SpaTools: Import Lidar Point Cloud (LAS/LAZ) files into AutoCAD

How to Clip objects in AutoCAD

Creating Contour Maps in ArcGIS and Conversion to AutoCAD drawing

SpaTools: Extract Topographic Profile From Contours In AutoCAD

Why GIS users should learn AutoCAD?

SpaTools: Toolbar with all tools