9 Replies Latest reply on Jul 26, 2016 9:24 AM by Sean Auger

    is it possible to cycle through user selected edges (like they were an array)?

    Sean Auger

      I'm trying to write a macro to add reference points to multiple pre-selected edges.  I'd like to be able to cycle through so that i can add the points both evenly distributed along the edges and at the intersections. 


      Basically, i'm pulling point clouds off of splines and exporting them to excel for manipulation.  I have the excel part down, but i'm currently manually adding the reference points.  Would like to be able to just select the multiple edges and have a steady distribution across all selected edges.



      bonus points:  not really a math guy, but is there a way to determine if an edge is a more or less extreme curve?  I'd rather have more points on the "bendier" splines and fewer on the straight ones.  If not, I can live with that.

        • Re: is it possible to cycle through user selected edges (like they were an array)?
          Amen Allah Jlili

          I don't really understand your question, perhaps if you can clear it up with an example. That'll be delicious
          You can certainly cycle through selected edges. Simply, each time, you select an edge, add to a collection object and iterate through it later. Face2::GetEdges will get you a list of edges.

          Use the Edge::GetCurve method to the get the underlying curve for the edge!

          • Re: is it possible to cycle through user selected edges (like they were an array)?
            Peter Brinkhuis

            Are you working with splines only? I think circles are the easiest and writing separate functions for different curves would make this easier. Catching all options with one procedure can be tricky.


            I suggest you do the following:

            • Select a curve
            • Start the macro
            • Make sure only one curve is selected, or loop through all curves
            • Get the selected curve into a variable
            • Get the type of curve so you can handle it accordingly
            • Get the length (GetLength) and shape
            • Assess the complexity of the curve, for example by calculating an average difference in direction of the spline tangents. If every tangent has a completely different direction, your curve might be complex.
            • Add points to the curve (in a 3D sketch probably) with a minimum and maximum amount of points per curve


            You can use GetCurveParams3 to get the parameters of a curve (ID, type, start point, end point and U parameters). I can't find proper documentation on the U parameters, but it seems to be a parameter that describes how far along on the curve you where.


            There are also tools on working with P-curves and B-splines, I'm sure you can figure out how to work with them yourself.