C # to save the drawing equipment information of Visio two development

Source: Internet
Author: User

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 ();
}

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.