6 Replies Latest reply on Sep 22, 2014 6:06 PM by Philip Morrow

    Macro to Cut and Measure Cross-Sectional Area

    Andy Norris



      I would like to make a macro that will make incremental cuts along the C-axis of a revolved body, then measures the surface area after each incremental cut is made, then exports each measurement as well as the distance along the C-axis into excel.  For a better mental image, imagine sushi.  It's rolled up then incrementally cut as you move along the C-axis, and I would like to know the surface at each cut normal to the axis.  I have a macro that can read x/y data of sketchpoints within a specified sketch, however I don't think I have the skills to modify this to accomplish what I'm trying to do.  Any help would be greatly appreciated!



        • Re: Macro to Cut and Measure Cross-Sectional Area
          Andy Norris

          Just to clarify since someone felt that I was asking others to do my work for me, here is the approach I'm taking:


          I have a solid body, and from one end I have a circle that's larger than the greatest diameter of the body.  I'm cut extruding along a centerline sketch, then doing a linear pattern that will advance the depth of the cut by a stepped amount with each additional # of patterns. 


          I have recorded the macro of selecting the face and measuring the surface area, but my confusion begins when trying to increment the amount of # of patterned features while taking the measurement in between each increment.  The exporting to excel portion I'm pretty sure I can figure out based on other work I've done, but if anyone could help with the incremental increase in the number of patterns, that would be wonderful.  I am more than happy to work in tandem with anyone up for the challenge - I would hate to come off as someone asking others to achieve my goal for me.


          Best regards

          • Re: Macro to Cut and Measure Cross-Sectional Area
            John Burrill

            OK, so it sounds like you need to make a reference plane coincident to the axis of rotation and at and angle from one of the other planes.

            You're going to drive that angular dimension to increment your section plane

            On that plane you're going to create  a sketch and do an intersection curve selecting the part-level of the tree as the curve source.  That will effectively make a sketch of the cross section of the entire part-including all bodies.

            You wire your existing macro into that sketch to take cross-sectional area

            Rinse and repeat.

            There's your pseudocode.

            break it down into tasks, modularize the bits of code you don't know how to create and go to the online help and the forums to get help with those parts.

            You'll find a lot more people willing to help you with a job when it doesn't look like they're going to have to do everything for you.