Skip to content

Database Connection Palette

(Available in XT Pro)

Default UI Menu: Tools/Palette/Database Connect

Ribbon UI Menu:

img

DoubleCAD has the ability to connect to a database and associate the data with objects. Database connectivity and management is handled through the Database Connection Palette.

img

To Create a Database Connection:

  1. Open the Database Connection Palette.

  2. Right click on the DataSources icon and click Add DataSource.

img

  1. In the Add Datasource dialog type in the name of the new datasource and click OK.

img

  1. The Data Link Properties dialog will open.

  2. On the Provider page select the appropriate OLE DB Provider type for the datasource to which you wish to connect. Then click Next.

img

  1. The Connection page will appear.

img

  1. Specify the database source. or

  2. Use connection String

​ 1. Click Build

​ img

​ 2. Select a File Data Source or Machine Data Source

​ img

​ img

​ 3. Set login info if needed, then press OK.

​ img

​ 4. Select the Database.

​ img

  1. Setup the Server login information.

  2. Click the Test Connection button. If the connection is valid the Test Connection Succeeded message will appear.

img

  1. At this point you can move on to the Advanced and All pages, or click OK.

  2. The features and functions of the Advanced and All pages are network and database specific, and are dependent upon your network and OBDC/OLE DB protocols. Only a person and experienced with your network and database protocols should alter these settings.

img

img

  1. After these operations you will see a new datasource object in DataSources tree.

img

  1. The datasource is not yet connected. Right-click on the datasource and select Connect.

img

  1. Your database is now connected to DoubleCAD as a datasource.

  2. When connected a datasource shows all available tables and views in database.

To Disconnect a Datasource:

  1. Select a connected datasource in the DataSources tree.

  2. Right-click on the datasource and select Disconnect.

img

To Re-configure a Datasource:

  1. Select a datasource in the DataSources tree.

  2. Right-click on the datasource and select Configure. This will open the Data Link Properties dialog.

img

  1. Make the required changes and click OK.

To Remove a Datasource:

  1. Select a datasource in the DataSources tree.

  2. Right-click on the datasource and select Remove DataSource.

img

  1. You will be prompted with a warning dialog.

  2. If you are clear to proceed click Yes.

To Export a Datasource:

  1. Select a datasource in the DataSources tree.

  2. Right-click on the datasource and select Export DataSource.

img

  1. This will open Save As dialog.

img

  1. Select a location and name for the datasource, and then click Save.

To Import a Datasource:

  1. Right click on the DataSources icon and click Import DataSource.

img

  1. This will start the Open dialog.

img

Note: Connect is only available when a datasource is disconnected. Disconnect is only available when a datasource is connected.

In order to connect data from tables to graphic objects it is necessary to create Link Templates. Link templates set a pattern that defines which the data elements will be linked from the table and associated with designated graphic objects. To Create a New Link Template:

  1. Select a table in the DataSources tree.

img

  1. Right-click and select New Link Template, or click the . The New Link Template dialog will appear.

img

  1. Type in a name for the link template, and then click OK.

img

  1. The Link Template Edit dialog will appear.

  2. Select the Key Columns. These are used to define link information data for linked graphics.

  3. Select the Value Columns. These values will be set as custom properties of the object.

  4. The created link template will be attached to current active drawing.

img

To Edit a Link Template:

  1. Select the template in the DataSources tree.

img

  1. Right-click and select Edit. The Link Template Edit dialog will appear.

img

  1. Make the required changes, and then click OK.

To Remove a Link Template:

  1. Select the template in the DataSources tree.

  2. Right-click and select Delete.

Warning: The link template will be immediately deleted. Removing a link template leads to removing all graphic links bound to it.

img

  1. You will be prompted to confirm the deletion.

Linking Data to Graphics

Data is linked to graphics by connecting a table to specific graphics via link templates. To Connect Data to Graphics:

  1. In a drawing, select one or more graphics.

img

  1. In the DataSources tree, double click on the desired table to select it for linking. This will also open the view of the table in the lower frame of the palette.

img

  1. In the table view, in the lower frame of the palette, click on the record you wish link.

img

  1. Use the Link Template drop-down box located on the palette toolbar to select the desired link template.

img

  1. Click the Create Link button on palette toolbar.

img

  1. The link between the selected graphics and the table record is created.

  2. Go to the Custom Properties of the object to verify the link.

img

Synchronizing Data and Graphics

To get data into linked graphics it is necessary to synchronize the data. The synchronizing process copies data from the datasource into all linked graphics and places it in the custom properties of linked graphics. To Synchronize Data:

  1. Click the Synchronize Data button on toolbar to run synchronizing process.

img

  1. Verify that the data has been synchronized by opening the properties of a graphic that is linked and going to the Custom page.

img

To Remove Links from Selected Graphics:

  1. Select the graphic/s you wish to de-link.

  2. In the DataSources tree select the link template you wish to de-link from the graphic/s.

img

  1. Right-click and select Delete Links(Sel).

img

  1. Synchronize the data.

  2. The links and data have been removed.

To Remove All Links to a Link Template:

  1. In the DataSources tree select the link template you wish to de-link.

img

  1. Right-click and select Delete All Links.

img

  1. Synchronize the data.

  2. The links and data have been removed.

To Find Graphics Linked to the Datasource:

  1. Select the datasource.

  2. Click the View linked objects in drawing button on palette's toolbar.

  3. Right-click and select Find Graphics.

​ img

To Find Table Record Linked to a Selected Graphics:

  1. Select a graphic.

  2. Click the View linked records in dataview button on palette's toolbar.

img

  1. All records which are linked to the selected object will be highlighted in the table view.

img

Viewing and Editing Data in Tables

When connected a datasource shows all available tables and views in database. Available tables and views appear as child nodes of the datasource.

img

To Show a Table's Content:

  1. Select the table in the DataSources tree.
  2. Right-click and select View Table, the table will be opened in the lower frame of the Data base Connection palette in Read-Only mode.

img

To Edit a Table's Content:

  1. Select the table in the DataSources tree.
  2. Right-click and select Edit Table, the table will be opened in the lower frame of the Data Base Connection palette in Edit mode.

img

(Available in XT Pro)

Default UI Menu: Tools/Database

Ribbon UI Menu:

img

All properties of objects are elements of a database. Standard database property items include line width, color, coordinates of points that comprise the object, etc. The database management feature enables you to add information to objects and to create reports using this information. For example, you can add custom fields to provide information on suppliers, manufacturers, price, etc. The information can then be presented as a Bill of Materials, Parts List, or other type of report. Database management and report creation generally follows these four steps:

  • Step 1: Define Custom Fields
  • Step 2: Attach Custom Properties to Objects
  • Step 3: Define Fields for the Report
  • Step 4: Create the Report

The following example shows how to create some custom properties, then create a report from the custom and standard properties. The objects in the report are shown below: a large plastic disc, two cubes on top, and six steel cylinders below. img

Step 1- Define Custom Fields

Default UI Menu: Tools/Database/Define Fields

Ribbon UI Menu:

img

The first step in creating a database is to define the types of information to be recorded.

  1. Select Define Fields. In the DefineFields window, enter the first property: "Part Number."

img

  1. Fill in the remaining fields in this row

img

Data Type: Text: Alphanumeric information which does not have to be calculated. Integer: Whole numbers. Double: Decimal numbers. Currency: Dollar amounts. This type will not appear in an object's Custom page of the Properties window. Visible: If checked, the field will be visible and available for use in the Edit Object Data and Report windows.

Tip: If you know you will not be using certain fields in reports, it is helpful to turn off visibility.

Editable: If checked, the field can be edited in the other database dialogs. Auto fields are always non-editable. Description: An optional field for notes or other comments.

  1. To add the next property to the database, click in the first empty field under Field Name, and type the new field name. This example uses "Description," Vendor," and "Cost." Then continue to fill in the other fields.

img

Note: To delete a record, click the square at the beginning of a row, and select Delete.

  1. Click OK when the custom properties are defined.

Step 2- Attach Custom Properties to Objects

  1. Select the object whose custom properties you want to define. If multiple objects have the same custom properties, such as the cubes below, select them all.

img

  1. Open the Properties to the Custom page. Click Attach at the bottom of the window.

img

  1. Select all of the custom properties and click OK.

img

  1. Now the properties appear on the Custom page. Fill in the Value for each part.

img

You can also enter or change custom properties in the Selection Info palette.

img

  1. The previous values were for the two cubes (Part Number 1); the values below are for the large disc (Part Number 2).

img

  1. These values are for the six support cylinders (Part Number 3).

img

  1. To verify that the custom properties were properly attached, select one of the objects.

img

  1. Then select Tools / Database / Edit Object Data. You can update values in this table, if needed.

img

Step 3- Define Fields for the Report

Default UI Menu: Tools/Database/Report

Ribbon UI Menu:

img

  1. To begin defining the report, select Tools / Database / Report. Then click Create.

img

  1. Enter a report Title and Comments (optional). If you choose Detail, only values from editable fields may be edited before the report is created. With Summary, all values may be edited before printing, even if they come from a non-editable field.

img

Note: "Object ID" is a unique identifier, and is generated automatically when attaching fields to objects.

  1. The custom fields appear under the "Custom" category. Click the "plus" sign to expand this category.

img

  1. For each field you want to appear in the report, click it under Available Fields, then click the Add button. The field should then appear under Report Fields. Repeat these steps for each of the custom fields.

img

Note: If you have block in your drawing with attributes you can add those attributes to your report.

  1. Non-custom (standard) fields can also be added to a report. In this example Material is added, and Material is found in the "Common" category.

img

You do not have to create a report using custom fields; reports may contain only standard fields.

  1. The order of the Report Fields list is the order that will in the report. To change the order, highlight the field you want to move and click Up or Down. (You will also be able to change the order later.)

img

  1. You can use a query if you want to filter the objects to be included in the report. If you want to run a query, click Edit. Otherwise, all objects in the model will be scanned while creating the report.

img

An example of a query in this example would be to search for objects that have "Part Number" fields greater than one. This is how the syntax would look:

img

  1. If you created a query, click OK to return to the Report Create window.

  2. Open the Advanced Report table.

img

The appearance of this tab depends on whether you are creating a Detail or Summary report. For a Detail report, Field Names can be edited. For a Summary report, Report Header Names may be edited.

  1. For the "Copy" row, click the cell in the Function column. From the drop-down menu, select SUM. This will show the total cost of all objects, not the unit price per object.

img

The other function options are AVG which calculates the average of all values, and MIN / MAX which displays the smallest or largest of the values.

  1. When all fields and queries are defined, click OK to return to the Reports window.

img

Step 4- Create the Report

Default UI Menu: Tools/Database/Report

Ribbon UI Menu:

img

  1. The Reports window now shows the report you have just created. (You can return to the Reports window anytime by selecting Tools / Database / Report.) Click Report.

img

  1. The Summary Report window shows the fields and values that will go in the report. If you want to re-order a column, drag its header to the new location. You can also click on a header to change that column's sorting order. To add a row for cost sums, click in a cell below the last "Cost" items. img

  2. Then click Grand Total.

img

The sum of the cost items is now listed.

img

The other available options at the top of the Summary Report window are: Export: Saves the report as a Microsoft Excel Spreadsheet (XLS), Microsoft Access Database (MDB), a Comma Separated Value (CSV), or a Tabbed Text File (TXT). Page Setup: Sets the format of a printed version of the report. You can add the page number, number of total pages, date, and/or time to the header or footer of each report page. You can also set the margins, alignment, page order, and scale of the report pages, and whether grid lines, row headings, and column headings will be printed. Print: Prints the report using the Print Setup options.

  1. To place the report in the file, click Insert Table into the Drawing.

img

  1. In the Insert Table window, set the sizing options for rows and columns. You can also set the table style here.

img

  1. Click to place the report as a table in the drawing.

img

The table contains the custom fields, as well as the Materials field.

img

  1. If you want to change the style of the report table, make sure the style is defined under Table Styles in the Style Manager.

img

  1. The style is assigned to the table in the General page of its Properties.

img

If you change the style, the table will update automatically.

img