12 Replies Latest reply on Jan 21, 2015 3:56 AM by Deepak Gupta

    Making dimensional updates to a entire directory of parts

    Greg Kramer

      Hello All

       

      I have recently been tasked with updating our fastener library. Our existing library has all of the screws modeled to their minor diameter. We, as a company, have made the decision that we would be better served with screws modeled at their major diameter. (Take this pile of dirt and move it over here.... here's your spoon) To me this means that I have around 1,000 screws that need to have their thread diameter updated from minor to major. I am hoping that there is any easy way to write a macro that could step through a directory and make this update to every part. I have very limited experience creating macros so I'm not even sure that this is possible. I would appreciate any input

       

      Some things to note.

      All of these screws are modeled identically. So the dimension that needs to change will be D3@Sketch1 in every single part.

      The screw sizes range from 2-56 up to 1/2-13

      The parts are already organized in directories with other like parts, pan heads, flat heads, etc.

       

      Due to the different standards for different types of screws there ends up being several different minor diameters for each major diameter. The following is an example of a few screw sizes.

       

      2-56__Minor__Major

                .0717    .086

                .0822    .086

       

      4-40__Minor__Major

                .0925    .112

                .1075    .112

       

      6-32__Minor__Major

                .1141    .138

                .1329    .138

       

      My logic here is to run a macro that will open a part, evaluate the existing D3@Sketch1 dimension, if D3@Sketch1 is .0717, then change it to .086. Else if D3@Sketch1 is .0822, then change it to .086. Else if D3@Sketch1 is .0925, then change it to .112. etc. Once the macro runs through the list of possible dimensions it would save and close the part, then move on to the next part in the directory.

       

      Attached is a complete list of the different dimensions I'm looking at.