Parameters are available across the model.
If you want to distinguish them between sketches, you'll have to give them names that help, say
Sk1_D2, Sk2_D2, Sk3_D2 or D2_Sk1, D2_Sk2.... or some other scheme.
David,
I won't be able to change the names of the parameters since I am trying to write a "generic" script. That is, one that can be used on multiple parts without prior knowledge of what is in the part. Basically I am trying to make a script that patterns a feature by duplicating everything used to create that feature, but changing the dimensions according to some function of instance number(currently just a simple step value on one dimension). My plan is the following:
Step 1, query the part and get a list of features. use this list to populate a user interaction window that lets the user select which part they want to pattern. I have this working. (by the way, it would be a nice feature to add to the API to have a "WindowsInputTypes.Feature" option for the Windows.OptionsDialog)
Step2, using the feature, get information about it. The sketch, whether is is an extrude/revolve cut/boss (I am ignoring more complicated things like lofts or helical), what the axis of revolution is(for revolves), and the dimensions used in the sketch. Currently I have succeeded in getting the sketch, and am working on getting the dimensions.
Step 3, in a loop make new sketches for each pattern instance by: saving the initial values of the dimensions(from the pattern leader), modify the pattern leader sketch with the new dimensions for that instance, copy the modified sketch to a new sketch, finally restore the original dimensions. (this is necessary because I have found that when I copy a sketch, the constraints and dimensions are not copied, so all modification has to be done on the original sketch)
Step 4, in a loop go through the generated sketches and apply the appropriate operation: extrude/revolve boss/cut.
Thanks,
Jenn