This blog explains the concept of links and linksets in Project Explorer (PE). This also gives a background of how we can create a new links and linksets. I'll also discuss about portability of links. This blog is valid for MicroStation XM and onwards. As I explained in my last blog (Project Explorer-101), PE consists of links.. A Linkset is a hierarchical collection of links. The hierarchy is meant for organizing links in a logical fashion. Every dgn file can contain several Linksets, each Linkset containing a hierarchy of links, each link pointing to some information or target, inside or outside MicroStation. This makes PE a convenient way of arranging information spread across different files, directories and formats (We will come to different formats supported by PE in next blogs). How do we create a linkset in PE? We have a separate dialog for this in MicroStation called "Link Sets". We can invoke this dialog from two places. First one is the browse icon "Manage Link Sets" on the right side of Project Explorer dialog and other one under "Drawing Composition->Organize" category in tasks navigation dialog.
What links you see in PE depends on the mode? Mode actually decides the source dgn/dgnlib files for linksets. Currently we have three modes in PE: "Active File", "Selected File" and "Configured Libraries". I would be explaining about these in upcoming blogs. For now we will stick to "Active File" mode which actually makes the current active dgn file as the source for linksets. If you are opening the MicroStation for the first time, it will always open with "Configured Libraries" mode. This actually sets all the files under "MS_DGNLIBLIST" configuration variable as the source. You need to change it to "Active File" mode using combo box in the above dialog. "Link Sets" dialog shows all the linksets that you have in the active dgn file. Depending on which linkset is active, you see the content of these linksets in PE. You can create a new linkset using first icon in this dialog. This actually opens a modal dialog where you can enter the name of the linkset. A linkset name must be unique in a dgnfile. The new created linkset shows up immediately in PE. PE lets you add links and child linksets to this linkset. Since you have a created a new linkset, this is time now to add some links in this linkset. Let's add two model links, one pointing to a model in active file and another from external file. You can use dragdrop for adding a model link from active file. Open models dialog and select a model. Drag-drop this model to PE. This creates a model link in PE. You could dragdrop multiple models as well. For adding a model from an external file, click on the first "Create Link" icon in PE and select "Link From File" option. This will open file browser dialog. This dialog has the toggle for "Save Relative Path". If this toggle is on, the link that you create saves the relative path for the target file. This helps us in portability. You need to select a file which contains the model. Then "Links Target" dialog shows up. This shows the selected file as the root node. If you expand this root dgn file, you can see the contents of dgn file including models. Selecting the model adds the model link in PE.
You can have multiple linksets in a dgn file. If we see the link sets dialog, the icons next to create linksets allows us to copy/delete a linkset and also import linksets from an external file. Deletion of links or linksets should be done with care as these are undoable actions. The right-click on a linkset also gives us an opportunity to rename/copy/delete a linkset. "Link Folder" in PE again a linkset. It can host several links. The second icon in PE lets us create a link folder. This is just parallel to a directory in windows explorer. We can have several directories and files in a directory which resembles with the tree structure that we have with links and linksets. Link Folder actually gives us flexibility to arrange links in a given linkset. Every tree node in PE represents a link or link folder. Tree node is in itself an independent entity. It has the information about embedded link or link folder. You have a liberty to give suitable names to these nodes. You have "Rename" option on right-click context menu of each node. Remember renaming a tree node does not affect the internal data stored in this node. For example, a model link will continue to point to the same model even if we rename the tree node. The name of the tree node should be unique in its hierarchy level. We call the name of the tree node as "LinkName" in MicroStation. This is what we see in the links properties dialog.
Let's talk about validation of a link. We create a model link PE which actually points to a model in active file. What if we delete this model from the active file? This will of course make the corresponding link in PE invalid. This is a very important feature of PE. In this case, the link is not tied to the model. Only when you ask to open the model or get the property, PE will try to search for the target model. This also means that user can create a link to non-existing model by editing the property of a link. How can we segregate all the invalid links in PE? If you right-click on this model link and select the "validate" option, the tree node turns red. We can make this link valid by restoring the deleted model or make this link point to another model using link properties. We can select multiple links in PE and use the validate option to find all the invalid links in PE.
In this blog, we mentioned about creating links and linksets. Future blog would be on modes in Project Explorer. So be there!
Thanks for your suggestions.
Follow Link for reference is designed to open that reference in its parent model. We will consider adding separate options like Activate and Exchange in future release.
I asked the very same question in a thread on one of the forums. Didn't really get an answer. It would make a lot more sense if Open exchanged into the reference file.