Today, I was asked by a user if GeoTools could do lineworks intersection cleanup. He sent me a DWG file which looked something like the figure shown below and he needed the junctions cleaned up. Lineworks intersection cleanup is one of the common tasks often required by CAD users but the term Intersection Cleanup means different things to different users.
Intersection cleanup can be easily done with a combination of the GeoTools command GT_INTEX and a small round of AutoCAD editing. In this post, I will show you how.
Our objective now is to break all the lines where they intersect each other and and delete the inner lines manually and get the desired result. We use GT_INTEX command for this purpose. The command can be found at the menu location GeoTools -> Drawing Cleanup -> Lineworks Intersections Processor.
Upon starting this command, you get a menu which looks like this:
In the dialog box, you see two sets of object references called "Source" and "Target". These two sets can work on each other to determine intersections. In this particular case, we don't need Target objects, instead we make the "Source" objects work upon themselves, determine intersections and break at all intersecting points.
Select all the objects as "Source". Check the Object Break Options and select "Source Objects Only". Do not select any Target objects. Choose "Same as Source Objects" in the "Target Selection Conditions" and Click "Ok" and allow the command to run. Upon execution you have the lines broken at each intersection point. You now only need to do implied window selection and get rid of all the inner pieces of lines.
You have got your desired result.
Further, you can now use GT_PLJOIN (GeoTools -> Polyline ToolSet1 -> Automated Join - 2d polylines) to assemble them back into polylines, if required.
You can read this blog in Spanish also. Click here...