You want to get the sweep length into the parameter of the part to pass it, for instance, to the parts list or for other purposes.
For doing this:
- Download and unzip this iLogic Rule to your local drive.
- Open your part file that contains the sweep.
- Rename the sweep (or the one you are interested in, in case you have more than one sweep in your part) as "TheSweep"
- Create an iLogic rule copying the script from the file you have downloaded.
- Run the rule.
- The rule creates or updates an user parameter called "Sweeplength" that contains the length of the sweep.
- Trigger the rule on "Part Geometry Change" for updating the "Sweeplength" parameter automatically if you change the sketch dimensions of the sweep path.
Note. The rule works on both 2D and 3D sweeps with the exception including 3D sketches that have bends in them.
I got very excited when I saw this post, until I saw the note: "The rule works on both 2D and 3D sweeps with the exception of 3D sketches that have bends in them."
I discovered this issue with 3d sketches with bends in them a few months ago and tried various methods to get the length but couldn't crack it.
Posted by: Gavin Bath | 09/07/2011 at 02:13 PM
Unfortunately the API call does not take bends into account.
I hope the rule can be useful in some way.
Regards,
Ale
Posted by: Ale | 09/08/2011 at 04:32 AM
..doesnt work with "3D Sketches with bends"... would be great if it did. Most all of the hose runs that I make has a bend radius added at the bend. I guess its back to manually measuring the loop.
Posted by: Kirk | 09/08/2011 at 10:56 AM
It works if you create 2nd 3d sketch in which you use "Include Geoemtry" and include all the lines and bends from primary sketch. Then create "TheSweep" based on the 2nd sketch.
http://screencast.com/t/xpqhhwaqK
Posted by: Sašo Prijatelj | 09/09/2011 at 05:32 AM
We changed the code slightly and it now also works on 3D sketches with bends. The problem was that the GetTruePath API call has a flaw.
We replaced that call with the Sweepfeatures.Path API call which works correctly.
Bob
Posted by: Bob Van der Donck | 09/09/2011 at 02:27 PM
Thanks guys, this has saved all sorts of weird work arounds.
Posted by: Lance W. | 10/05/2011 at 08:11 AM
GREAT JOB
Posted by: JAY | 05/01/2012 at 05:00 PM