Revit Polyline Fit and Spline

Just some fun stuff…

This started out several years ago as just simple Dynamo routine to make a pseudo Pline tool for Revit. At the time it was used mostly for “soft” site elements like ponds and walkways. Output was native Revit splines.

Then it was converted to pyRevit, just running a dyn file. Followed by full Python using a dynamo bridge.

But the company I’m with now works with a lot of archival DWG files, so I wanted output that was closer to the native AutoCAD Pedit tools. The Pedit Fit Curve doesn’t create a spline, but rather a series of tangent arcs passing thru all the points. So I had multiple iterations of calculating tangent arcs like AutoCAD. Arcs are good for construction dimensioning. I got it verry close but never perfect.

So back to AutoCAD (which I avoid like a bad dream). Ran across AutoCAD Core Console. So spun up LISP - my first programing language (wanted to stick to plain text code rather than jump over to C)

A bunch of refactoring and plenty of typing help from our friend ChatGPT and now have AutoCAD Pedit Fit.

Some fun code for merging multiple technologies. I kept some old dynamo more as example (and it works fine.) And have a fall back for systems that don’t have AutoCAD installed. I’ll probably revisit deciphering and replicating Pedit Fit at some point, but this works and I’ll probably use the AutoCAD Core Console for some other tasks down the road.

Github Polyline Script

2 Likes