<< Click to Display Table of Contents >> Using Advanced Conditions |
This chapter describes the use of Advanced Conditions in case the Simple Conditions do not suffice.
A link with the project created during this chapter is at the end of this chapter.
In this example, we want to map a pipe spec to a line segment based on the service and size of the line. We have this table with the service and a size range for each spec.
|
Creating the Link Configuration
We start again with selecting the database file. We keep the Update properties option. We select PipeLineSegments. We select the table. But now we switch from Simple Conditions to Advanced Conditions. To add conditions we move the mouse to the And where a + will appear. After clicking on the + we select Add Condition from the context menu. A condition will appear automatically. We click in the FromSize and a dropdown list appears with all columns from the external table. We select ServiceCode. Next we click into the condition and select = Equals. Next we click on the pencil icon left of the text Enter a value.... Now it changes to a list symbol which indicated, that we could select a column from the table. But this is not what we want. instead we click again on the icon. Now we see a ?. If we click now in PnPID we will see all Pipe Line Segment properties. We select LineGroupService. We could now ad more conditions in this visual mode, but we will fail. This will become obvious further down. We click on Text to switch to the text mode. Now we see the existing condition in a text form. We extend this expression by adding And [FromSize] <= ?Size And [ToSize] >= ?Size. What this means will be explained shortly. Then we toggle back to the visual style. Now we see all three conditions which must be true. But what do these conditions mean in detail. First, the service of the line segment must exist in the table. Secondly, FromSize <= ?Size requires, that the Size of the line segment must be greater or equal than the column FromSize. Thirdly, the Size of the line segment must be less or equal than the column ToSize. Essentially, the second and third condition mean, that Size must be between FromSize and ToSize. And the reason why we couldn't define the second and third condition in the visual style is, that FromSize and ToSize are numeric columns in the table, and Size is a string property. The Expression Editor is checking the data type and therefore, we cannot select the Size property when comparing it to FromSize or ToSize. Now we map the PipeSpec to spec. And finally give the link configuration a name. As always we check if the new link is Active.
|
If we select Size 25... ...the Spec is SPEC1. If we change to 200, Spec will be SPEC3. If we change it to 100 the PlantLink - External Data Viewer will open, because for 100 we have options now. 100 is between 40 and 150, but also between 65 and 100. W select SPEC4. If we change the Size to 80 nothing happens. This is because SPEC4 is still valid and there is no need for updating the Spec property, because SPEC4 can be used between 40 and 150. Remark: This is an important fact when using PlantLink. If you change the property values used for the linking, and the new values lead to the same mapped values, then nothing will happen with the mapped properties. If you use Assign Data from the context menu of the line segment... ... you now can select the again from you two choices. Now the Spec changed to SPEC2.
|