10 Replies Latest reply on Jun 8, 2015 11:33 AM by Steve Soeder

    How to copy a data card variable from template card to new file card??

    Steve Soeder

      This seems like it should be easy, and I find it hard to believe there is no way to do this as it should be simple/basic functionality, but I'm struggling here.

      -  I have a template card.  On the template card is an edit box.  The edit box is tied to variable T_Score.  The value comes from an input formula which generates a number based on which of a group of checkboxes on the template card are selected by the user.

      -  The file card for the new file that is created by this template also has an edit box.  It is tied to variable F_Score.

      -  Lastly, I've created a template variable called TEMP_Score.

       

      What I need, is to copy T_Score (result of the input formula) to F_Score.

      Problem I'm having, is there doesn't seem to be any way to copy T_Score to TEMP_Score.

      It appears I can only populate TEMP_Score using the following options:

      -  Environment variable (can't copy from a data card "X2" variable)

      -  Format string (I actually tried copying the input formula here - it crashes windows explorer.  Repeatably.  And it doesn't actually populate the variable with the score.)

      -  Name of logged in user (nope)

      -  Prompt the user (nope)

      -  Serial number (nope)

       

      So to reiterate, what I need is a way to populate the TEMP_Score template variable from the data card (X2) variable T_Score.

      How can I do this?

      It seems like it should be simple, but I'm not seeing how I can do it???

       

       

       

      Message was edited by: Steve Soeder Edited for clarity.

        • Re: How to copy a data card variable from template card to new file card??
          Steve Soeder

          Just to add to this discussion, I tried using the "Format string" type and I pasted the input formula right in there.

          When I tried to execute the template it crashed windows explorer.

          I re-opened the folder and saw the file was created but the variable was not populated.

            • Re: How to copy a data card variable from template card to new file card??
              Steven Richmond

              Steve

               

              First of all have you looked at the administration guide within C:\Program Files\SolidWorks Enterprise PDM\Lang\GB as a resource guide?

               

              Within The template cards section of edit template you have to link the card variable with a template variable.

               

              Untitled1.png

               

              Then within the files and folders section you have to then map the template variable with the card variable.

               

              Untitled2.png

               

              Or have I picked up the question incorrectly?

               

              regards

               

              Steven

                • Re: How to copy a data card variable from template card to new file card??
                  Steve Soeder

                  Hi Steven,


                  I think maybe my description wasn't clear of the problem.
                  It's not a problem with populating the file card variable from the template variable, but rather the opposite - I need to populate the template variable from the template card variable.

                  E.g. (i've changed variable names for clarity)

                  The template card has an edit box tied to variable "T_Score" - this is derived from an input formula that looks at other variables on the template card.

                  The file card has an edit box tied to variable "F_Score".

                  In the template wizard, I've got a template variable named "TEMP_Score".

                   

                  What I need is to copy "T_Score" to "F_Score".

                  I don't want to prompt the user for "T_Score" and it's not an environmental variable or anything like that. The value comes from an input formula.  I need a way to copy that score to the file card. When creating the template variable ("TEMP_Score") there is no option to copy a template card variable ("T_Score") that I can see.

                  I know how to populate "F_Score" from "TEMP_Score" - which is what you described above.

                  Problem is that I can't figure out how to populate "TEMP_Score" from "T_Score".

                   

                   

                  Does that make sense?

                    • Re: How to copy a data card variable from template card to new file card??
                      Steven Richmond

                      Hi Steve

                       

                      I thought I may have picked it up wrong, hope I've picked it up correctly this time.

                       

                      If you want the value of T_Score to populate TEMP_Score then create an edit box on the template card and link it to variable TEMP_Score. In the input formula for this edit box select the variable T_Score. This edit box will now populate with whatever you put in for the value of T_Score.

                       

                      It's a Monday so still not fully up to speed . Hope this helps.

                       

                      Steven

                        • Re: How to copy a data card variable from template card to new file card??
                          Steve Soeder

                          Steven, you make it sound so easy, as I thought it would be!

                          However using input formula there is no option for selecting an x2 (card) variable.

                          I can tie it to another template variable, or a handful of date/time formats.

                           

                          Here is a screenshot.

                          Like I mentioned in my last post I changed the names to make it more clear what I was trying to do, so variable names are a little different in this actual screenshot, but the goal is still the same.

                          I have the card variable "DRR_ImpactScore".

                          I have the template variable "T_Score".

                          I don't see how I can populate "T_Score" from "DRR_ImpactScore".

                           

                            • Re: How to copy a data card variable from template card to new file card??
                              Steven Richmond

                              Steve

                               

                              Any chance you could export the template and attach it here? I can then have a look at it if you want as well as giving a better understanding.

                               

                              Thanks

                              Steven

                                • Re: How to copy a data card variable from template card to new file card??
                                  Steve Soeder

                                  Hi Steven,

                                   

                                  Template and file card exports attached.

                                  If you find any other problems don't worry about them - I may not have de-bugged everything yet as I'm still trying to work out this seemingly simple operation.

                                   

                                  Thanks!

                                    • Re: How to copy a data card variable from template card to new file card??
                                      Steve Soeder

                                      I have it working.

                                      When you create the template variable, if you set it to "format string" and leave it blank, it will copy the value from whatever card variable it is tied to.

                                      The problem is that this wasn't working because I had control logic on the template card that was hiding the edit box.

                                      Since this wasn't working, it led me down the road of trying to find something that explicitly tied the card variable to the template variable.  This explicit link doesn't exist, but there is an implicit link that if you leave the format string blank, it will copy the value from the template card.

                                       

                                      This is not really described in the documentation, but I guess can kind of be assumed from the wording "Variables to copy for selected card" (pg 318 of the 2015 admin guide).

                                      I actually figured this out from digging through my training manual from when I took the admin class and in one of the demo exercises I saw how they were copying values this way.

                                       

                                      On another forum post I had about how to get the input formula working, it was suggested that if you use control logic to hide a control, there can be issues.  It seems that if you use control logic to hide the control, than the value of it's variable won't be available to use for other input formulas or for templates.

                                      And this is documented on page.....oh wait, it's not.

                                      I absolutely hate this software sometimes! 

                                      I can't even begin to guess how many hours I've wasted hunting things down because behavior is not as expected and is not documented anywhere.

                                      It's hard to believe Solidworks even puts their name on this garbage.

                        • Re: How to copy a data card variable from template card to new file card??
                          Steve Soeder

                          Yep, this is what I had to do.
                          I added a label that is hidden by control logic (always hidden) that at least reminds me it's there.