# How can I adress a specific Model Element or Diagram as Query-Parameter (Fill-In Doc)

**URL:** <https://forums.visual-paradigm.com/t/how-can-i-adress-a-specific-model-element-or-diagram-as-query-parameter-fill-in-doc/14980>\
**Category:** How To\
**Tags:** generate-document\
**Created:** [February 11, 2019, 9:48am UTC](https://forums.visual-paradigm.com/t/how-can-i-adress-a-specific-model-element-or-diagram-as-query-parameter-fill-in-doc/14980 "2019-02-11T09:48:13Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![vhalstenbach](https://avatars.discourse-cdn.com/v2/letter/v/a6a055/32.png) [@vhalstenbach](https://forums.visual-paradigm.com/u/vhalstenbach)\
**Post date:** [February 11, 2019, 9:48am UTC](https://forums.visual-paradigm.com/t/how-can-i-adress-a-specific-model-element-or-diagram-as-query-parameter-fill-in-doc/14980/1 "2019-02-11T09:48:14Z")

</div>

Hi there,

when creating a Fill-In Doc I want to adress a **specific** DIAGRAM or ELEMENT of my model **without having to select it later on in VP DocComposer**.

Eg. I would like to place a statement like perhaps  
${DIAGRAM, “Use Case Diagrams (Admin)”, “UseCaseDiagram”, **Any=“MySpecificDiagramName”** , PROPERTY=name}  
into my Doc Base. As a result after importing my Doc Base into Doc. Composer I would not have to pick the specific diagram; instead Doc. Composer would find and select it automatically for me (without further interaction from me). Same idea applies to ELEMENTs…

Background is: If I need to change my Doc Base Word-Document I always have to re-pick my DIAGRAMs and ELEMENTs queried with “One” or “Any” by hand when I want to re-generate my project documentation.

How can I achieve this in VP?

Thanks for any input  
Volker

---

<div class="post-metadata">

**Author:** ![peter.wong](https://forums.visual-paradigm.com/user_avatar/forums.visual-paradigm.com/peter.wong/32/3250_2.png) [@peter.wong](https://forums.visual-paradigm.com/u/peter.wong)\
**Post date:** [February 12, 2019, 1:23am UTC](https://forums.visual-paradigm.com/t/how-can-i-adress-a-specific-model-element-or-diagram-as-query-parameter-fill-in-doc/14980/2 "2019-02-12T01:23:22Z")

</div>

in `${DIAGRAM, ...Any or One, ...}`. you can specify:  
`PreferredDiagram.Name={diagram.name}`  
e.g.  
`${DIAGRAM, ..., Any, ..., PreferredDiagram.Name="My Diagram Name", ...}`

in `${ELEMENT, ...Any or One or LoopInElement, ...}`, you can specify:  
`PreferredElement.Name={element.name}`  
`PreferredElement.UserId={element.userId}`

in `${ELEMENT, ...LoopInDiagram, ...}`, you can specify:  
`PreferredDiagram.Name=diagram.name` with _LoopInDiagram_

---

<div class="post-metadata">

**Author:** ![vhalstenbach](https://avatars.discourse-cdn.com/v2/letter/v/a6a055/32.png) [@vhalstenbach](https://forums.visual-paradigm.com/u/vhalstenbach)\
**Post date:** [February 12, 2019, 7:47am UTC](https://forums.visual-paradigm.com/t/how-can-i-adress-a-specific-model-element-or-diagram-as-query-parameter-fill-in-doc/14980/3 "2019-02-12T07:47:40Z")

</div>

Thanks a lot for the hint, looks pretty much like what I’m looking for. Is there a documentation available for additional parameters like those PreferredElement and maybe more? I was not able to find them in the Doc. Composer user guide.

---

<div class="post-metadata">

**Author:** ![peter.wong](https://forums.visual-paradigm.com/user_avatar/forums.visual-paradigm.com/peter.wong/32/3250_2.png) [@peter.wong](https://forums.visual-paradigm.com/u/peter.wong)\
**Post date:** [March 1, 2019, 8:07am UTC](https://forums.visual-paradigm.com/t/how-can-i-adress-a-specific-model-element-or-diagram-as-query-parameter-fill-in-doc/14980/4 "2019-03-01T08:07:07Z")

</div>

Sorry, the document is not yet ready.

Let me try to show you here

```auto
${DIAGRAM, ...}
* format: ${DIAGRAM, name, "DiagramType(0..N)", NUMBER_OF_DIAGRAMS[One, Any, LoopInProject, LoopInElement], TEMPLATE[template_name, PROPERTY=property_name, ICON, IMAGE]}
*
* --- additional arguments ---
* SortBy=property_name(1..N)
* or
* SortBy=NoSort
*
* PreferredDiagram=Address of DiagramWithData(0..1)
* PreferredDiagram.Name=Name of DiagramUIModel(0..1)
* // the preferred diagram selected in this doc fields. If this doc field has no diagram selected, will find out this preferred-diagram, and assign into this doc field.

${ELEMENT, ...}
* format: ${ELEMENT, name, "ModelType(0..N)", NUMBER_OF_ELEMENTS[One, Any, LoopInProject, LoopInElement, LoopInDiagram], TEMPLATE[template_name, PROPERTY=property_name, ICON]}
*
* --- additional arguments ---
* SortBy=property_name(1..N)
* or
* SortBy=NoSort
*
* PreferredDiagram=Address of DiagramWithData(0..1)
* PreferredDiagram.Name=Name of DiagramUIModel(0..1)
* // the preferred diagram selected in this doc fields. If this doc field has no diagram selected, will find out this preferred-diagram, and assign into this doc field.
* // used when NUMBER_OF_ELEMENTS = [LoopInDiagram]
*
* PreferredElement=element.address(0..1)
* PreferredElement.Name=element.name(0..1)
* PreferredElement.UserId=element.name(0..1)
* // the preferred element selected in this doc fields. If this doc field has no element selected, will find out this preferred-element, and assign into this doc field.
* // used when NUMBER_OF_ELEMENTS = [One | Any | LoopInElement]
*
* PreferredExcludedModelTypes=modelType(0..N)
* PreferredExcludedInstances=element.address(0..N)

${PROJECT, ...}
* format: ${PROJECT, TEMPLATE[template_name, PROPERTY=property_name]}

${TEXT}
* format: ${TEXT, NAME}

${PROPERTY, ...}
* format: ${PROPERTY, xxx}

${IMAGE}
* format: ${IMAGE}

${ICON}
* format: ${ICON}

${TEMPLATE}
* format: ${TEMPLATE, template-name}

```

PS: ${PROPERTY}, ${TEMPLATE}, ${IMAGE}, ${ICON} are used in a table,  
which for-each a set of elements/diagrams and generate them into rows,  
using the ${PROPERTY, …}, etc… to generate the current element/diagram’s property, template, icon, image.
