3 Replies Latest reply on Nov 20, 2013 11:07 PM by Andrew Dvorak

    Variables for XML Change Orders

    Andrew Dvorak

      Hi everyone,

       

      I'm currently using a Word document to create my ECOs. It is a macro driven form  where the user, in addition to having specific locations for entering data, has pulldown lists to aid filling out the form. There is also a macro that repeats a table in the document, one for each part added to the ECO.

       

      There are several problems with this Word document. For one, if there are a lot of items it can take a long time for the document to open in an editable or readable form. Just 4 items on the document takes 20 seconds. One dcument with 35 items on it took almost 5 minutes. Another issue is that not all people have either the correct version of Word, or even have Word, so I have to generate a duplicate PDF version for them, and then I put both documents through the same approval process.

       

      I have been looking at XML to achieve a better method as everyone has a browser and I've checked that a sample stylesheet will present the document to them the way I want. I am using a datacard to fill out the xml file, the number of items will be limited by the tabs that I have. I have a test datacard of 10 items.

      Image1.jpgImage2.jpg

       

      My question has to do with the variables necessary to keep item information separate. Typically, repeated groups of data would be in the XML file like this:

       

      <ECOItems>

           <Item>

                <Number>200-455</Number>

                <Description>Rod</Description>

           </Item>

           <Item>

                <Number>200-358</Number>

                <Description>Block</Description>

           </Item>

      </ECOItems>

       

      On the datacard, though, I could only figure out to do this:

      <ECOItems>

           <Item1>

                <Item1Number>200-455</Item1Number>

                <Item1Description>Rod</Item1Description>

           </Item1>

           <Item2>

                <Item2Number>200-358</Item2Number>

                <Item2Description>Block</Item2Description>

           </Item2>

      </ECOItems>

      There are 12 variables per tab for each item. For 10 items (tabs) that means 120 variables.

       

      Does anybody know a way I can reuse the same variables Number, Description etc, for each tab and have each tab maintain its unique values?

        • Re: Variables for XML Change Orders
          Clark Honzik

          Hi Andrew,

           

          I have been working on an add-in for this.  The issue I ran into is that a multi-line text box is capable of reading up the xml data like this but it is not capable of writing back to the xml file the same way.  I created an add-in that simply writes the affected items back directly to the xml file.  This has worked well so far.  Give me a call if you need more explination.

           

          Regards,

           

          Clark Honzik

          • Re: Variables for XML Change Orders
            Clark Honzik

            Also,

             

            I would be curious as to what your word macro looks like.  Something is not right if it is taking that long to generate the list.

             

            Regards,

             

            Clark Honzik

              • Re: Variables for XML Change Orders
                Andrew Dvorak

                Hi Clark,

                 

                Got your post, thanks. I was hoping to do what I wanted without an add-in but I'd be interested in talking to you about it.

                 

                I started on the xml path after seeing an Inflow-Tech video where they created an ECN using HTML to display the data, which they said they did without special programming. Yet they never disclosed exactly how they did it.

                 

                Right now I don't mind having to create so many variables. I just have to get my stylesheet formatted properly with the proper conditions so that either I can use a repeating table with a string function to change "Item1", "Item 2", etc  to" Item" on the fly, or I have to create a table for each item and then a conditional to say whether it is created or not for the html output.

                 

                I am also hoping Dispatch can do what I want. For ECOs we paste as reference the files being changed to the ECO file. I have found I only need to paste the drawings as the parts or assemblies get dragged along through the process. The benefit is users who want to review see only the drawing files under the Contains tab. If they double click on them they are opened either in Solidworks or eDrawings. I want Dispatch to populate the variables for each item, so I am hoping to create a command button that gets the part number, description and revision of each referenced item to fill out the tabs on the ECO datacard. I'll also have to check that the number of items is less than or equal to the number of tabs on the datacard.

                 

                Is all this possible?

                 

                Regarding the word doc, I can send you the .docm file if you want. I think it is the fact the document is a form that updates itself every time it is opened, so every list and checkbox is cycled through. There are 15 checkboxes per item and I forget how many lists.

                 

                Regards,

                 

                Andy