CAD Forum - tips, tricks, discussion and utilities for AutoCAD, Inventor, Revit and other Autodesk products []
Cesky English Deutsch
 Visitors: 5277 

CAD tip CAD tip # 10383:

Question CAD 
 %  platform  category 
Q - question

The shortest path between two points on a network.

A - answer There are various algorithms to find the shortest path between two points on a given interconnected network (pipes, communication, roads, etc.).

In AutoCAD Map, you can effeciently solve this task using topologies (including throughput parameters, asymmetry, penalty functions). In plain AutoCAD, you can find the shortest connection between 2 network nodes using the freeware LISP utility CADstudio SPath.

Download the SPath.vlx file from, load it into AutoCAD with APPLOAD and type the SPATH command. Select the lines and polylines defining the network and pick two node-points on this network (precisely, use osnap). SPath will compute and generate a red polyline of the shortest path copying segments and nodes on the given network. Adjacent segment nodes must match. The number of selected network segments directly influences computing time of the optimal path.

Example of using SPath on a road network map of the Czech Republic - from the DWG block SilniceTematicky:

see also YouTube

To generate the shortest path connecting multiple points, use the ShortPath utility (travelling salesman problem, TSP).

(original algorithm: H.Schröder)

100% *  CAD 
30.6.2015    3929×  
Comments   Tell a friend
applies to: AutoCAD ·

See also:
Tip 10416:How to fix/repair large 3D mesh models?
Tip 10128:How to convert a line-based map to closed polygons (lots)?
Tip 10102:How to simplify a complex 3D mesh model?
Tip 4068:How to find the polyline direction/orientation?
Tip 3541:"Topology is correct and incomplete" but it cannot be deleted.

Back   All CAD Tips All CAD tips&tricks

How to disable downloads for a selected file in A360 Team? « | » Move dimension text in AutoCAD context menu.

Have we helped you? If you want to support the CAD Forum web service, consider buying one of our CAD applications, or our custom software development offerings, or donating via PayPal (see above). You may also add a link to your web - like this "fan" link: CAD Forum - tips, utilities, blocks for Autodesk products
CAD:    OS:    Categ: 
Text:  FAQ glossary   

Make your drawings dynamic - change text, attribute or color when other entity changes.
With LiveLabel 2007 More info

Please use these tips at your own risk.
CAD Studio (Xanadu) is not responsible for possible problems that may occur as a result of using any of these tips.