In two of Visio development, when publishing drawings, we often need to save the drawings and drawings of the equipment information to the database, the drawing is to save the file to the database in binary, equipment information is to save the drawings corresponding to the shape of the various custom attributes. This article mainly introduces how to save the equipment information behind the drawing.
Here the equipment information of the drawings can be placed in a device table such as Device1 to place the same type of equipment information, such as load switch stored in Device1, overhead line placed in Device2, etc., Device (n) is our detailed placement of a type of equipment table, its structure is as follows
In addition, we will create a new table to manage that type of device corresponding to that table. As shown in the following illustration:
Once the relationship between the tables is established, we know what the table name is for that type of device. We pass the code
list<devicetableinfo> devicetables = Devicetabledal.getdevicetables ();
You can get information about all the device type tables, which will prepare us for the next step in saving the device information.
In order to get the table information corresponding to a device type, we can get its corresponding information.
String DeviceType = Visioutility.getshapecellvalue (Shape, "Device type");
Devicetableinfo tableinfo = Devicetabledal.gettablenamebydevice (Devicetables, DeviceType);
We know that the drawings have a lot of information, we traverse the drawing device, you can traverse its selection implementation, as shown below
if (Visioutility.hasshapeinwindow (Viswindow))
{
Viswindow.selectall ();
foreach (Visio.Shape Shape in viswindow.selection)
{
}
Viswindow.deselectall ();
}