cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Learn all about the Community Ranking System, a fun gamification element of the PTC Community. X

SAving copies of a Worksheet (Templated)

BStump-disabled
1-Visitor

SAving copies of a Worksheet (Templated)

I need a way from a master worksheet that has an array to save copies of another template worksheet (which may either be open or saved to disc). One cope per array item. And for each array item and saved worksheet I need to pass several values.

OK the master worksheet has an array representing panel positions, sizes and a specific distance. No need to really go into the what's and why-fors of this. But the templated worksheet that needs to be generated for each and every panel is what is important. It has a series of calculations that must be saved an ultimately printed for each panel.

As long as I can pass at least the panel number to the worksheet it can find and generate all its results. I will use a simple loop to walk thru the array but from there is my issue. I do not know how to:

1 - Copy a template file and save it under a generated name.

2 - Pass a certain value to some variable or a unit array so the worksheet know who it is.
7 REPLIES 7

Why multiple worksheets? Why not just rework the calculations as functions, and then loop through the desired values within a single worksheet?
__________________
� � � � Tom Gutman

You can file as many calculated arrays as desired from the same work sheet. Last three weeks or so, I posted a damned useful parametrized multiple CreateMesh. Spool to file retrieve from file. Your main work sheet will surely help.

jmG

I need to add one more this. I would like to get a pass/fail result back for each so I can log and include that as well.

For the moment assume I need to potentially modify each worksheet to personalize it with at minimum a comment as well as ensuring the panel inputs are correct. The biggest issue is I need to save and print each. But I think Tom is onto my solution. In my first panel worksheet I have it loop and then saveas with the appropriate input data. Then I can reopen and add the custom stuff if needed. I think that will work quite nicely with little change in my setup. I will have to include a button to allow or disallow the file creation so it does not overwrite work inadvertently. Would be nice is I knew how to add a pop up or other safety.

I will search for jmG's CreateMesh and see what it does as well.

This issues is only a small part of the overall projects. I have a series of calculations to do and a lot of them are repeated in a similar way.

>I will search for jmG's CreateMesh and see what it does as well.<<br> _________________________

Your project scope is a bit hairy. It does not print in my mind on reading. Large projects go better if started not too automated. The attached is particular to a special application of the parametrized 'b' CreateMesh that is not the Mathcad built-in CreateMesh but does all the same +.

jmG

PS: The scripted components are two sliders.

Pass/fail results can be calculated by functions just as well as any other type of value. Limited comments can be included in the input in the form of text strings. With nested arrays you can have quite a bit of commentary.

If you are planning to manually open and modify each of the resulting sheets anyway, it's not clear how much you save by generating them automatically rather than just creating them manually (based on a template) and inserting the required data, either by importing from a file or copy and paste.

If you really need automatic creation, you could modify my define variables sheet ( http://collab.mathsoft.com/read?112283,11 ) to modify a worksheet other than the current one. Open and saveas are available methods in the automation API.
__________________
� � � � Tom Gutman

The PTC newsletter (just out) has an article on displaying results in a text box and setting the colour.

It is easy to update the (VBscript) code to pass in the test limit for a full functionality.

http://www.imakenews.com/ptcexpress/e_article001537744.cfm

Philip Oakley

Announcements

Top Tags