- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
With the help of this forum, I've been able to put together a small program to measure the length of a loop, calculate length of chain (and # of links) based on that, and update properties accordingly. There's a bit more to it, but that's the basics.
At the most basic level, assuming you've named your sketch containing the chain path as "Path", these lines will find that sketch, and return the value of the loop:
'Calculate length of sweep- returned by function in centimeters Dim PathSketch As SketchEntity = ThisDoc.Document.ComponentDefinition.Sketches("Path").SketchLines(1) PathLengthMM = ThisApplication.MeasureTools.GetLoopLength(PathSketch) * 10
This path can be complex, but is usually just two arcs at the end of two line segments:
Usually, this works, but SOMETIMES, the logic will find the length of one line segment, not the whole loop.
Yes, they are connected, full loops. The model geometry is working just fine. It's a sweep of the chain's profile.
Using the measure command, it can find the loop just fine (cycling through the selection options).
How can I stop this erratic behavior, and ensure it finds the length of the entire loop, not just a segment?
Vault Professional 2021
Solved! Go to Solution.