Before you can define Word components, it is necessary to create the documents required for this purpose.
The predefined target file has to be split up into a main document and several fragment documents in a way that allows the target file to be recreated from them.
- Open ListOfComponents .docx located in the Tutorial\Word sub-folder in the installation folder.
- Replace the heading List of Components with #(Heading) on the first page.
The number string #{ instructs the parser to treat the following text up to character } as the name of a parameter and to replace with the parameter value.
- Also replace the image with #(Image:Logo) on the first page.
The parameter type is specified here as Image in front of the name of a parameter. Without this information String would be used as the type and, as a result, no image returned.
Do not make any changes to the table of contents.
- Delete everything below the second heading 1.1 Actuators on the third page and replace Actuators with (*{LOOP:dos}*)(*{Content}*)(*{END_LOOP}*).
The line contains three commands in the form of (*{…}*). The first and last commands act as a loop construct that iterates over all directly contained discipline components (dos = "discipline objects"). The middle command is responsible for their content.
- Save the open Word file as Body.docx in the folder resources\Tutorial\Word.
- Repeat the first step.
- Delete pages 1 and 2, the heading 1 Actuators and Sensors, the heading 1.2 Sensors, and the Sensors table.
- Replace the heading 1.1 Actuators with #{Heading}.
- Replace the word Actuators with #{Heading} in the table header.
- Replace the image for actuator () with (*{LOOP:dos}*) in the first row, the image for actuator () with (*{Content}*) in the second row, and the image for actuator () with (*{END_LOOP}*) in the third row in the Symbol column.
- Delete all table rows below this (positions 4 to 7).
- Add a second blank row below the table.
- Save the open Word file as Chapter.docx.
- Repeat the first step.
- Delete pages 1 and 2, all headings, and the bottom table.
- Delete everything except for the final row in the remaining table.
- Replace the image for actuator () with the #{Image:Icon} parameter, the number of the position with the #{Pos} parameter, and the descriptor with the #{Descriptor} parameter in the remaining table row.
- Save the open Word file as Row.docx.