ExtendCloseLines v.1.000
by Todd Burch


description A CAD cleanup script. This script will find lines that are fall short of touching their intended target and extend them in a straight line to touch their intended target.


ExtendCloseLines is another in the series of CAD cleanup scripts. It will extend lines along their vector to hit their intended target.

ExtendCloseLines (where "close" is meant in the proximity, or relative distance sense) will locate open ended line segments. For each open line segment (that is open on only one end), the script will determine if there is another line that it ought to be touching. A straight line is "visualized" by the script to determine if there might be a target line. If there is, then the distance to that point is checked. If the distance is less than 1/2 the length of the open line, then it will be extended. Thus, the use of the relative word "close".

Here is a before and after example. The following image shows two lines extending from a face and not quite touching the bottom line.

After running the script, you can see the two lines were extended straight down to meet the line at the bottom.

There is another script on Smustard called CloseOpens. At first, it might seem that CloseOpens does the same thing, but it does not. CloseOpens ties together two open ended line segments. Running CloseOpens on the first graphic above produces the geometry shown below. See CloseOpens for more information.

The red oval hilights the difference between ExtendCloseLines and CloseOpens. CloseOpens is more intended for use with site drawings and contours, whereas ExtendCloseLines is intended for arhitectural drawings. In other words, on an architectural drawing, CloseOpens is a more brute force approach to cleaning up a drawing, while ExendCloseLines yields results more in line with architecturally intended results.

If you import Architectural-style CAD drawings, this script should certainly be in your toolbag.

Install the script into your /Plugins folder. It shows up in the Plugins Menu.

This script requires ProgressBar.rb.

This script is one is a series of scripts that can be used to clean up imported .DXF and .DWG files. Also see: Updates:
  • October 09, 2007: V1.0 - Works with Windows and Macs, Free and Pro. Sketchup 5 and up.

see also other plugins by Todd Burch:

notice By purchasing and installing this plugin, you indicate that you have read and agree to the terms and conditions of the End-User License Agreement (EULA). Prices subject to change.