Скачать презентацию PROGRAMMING GRAPHICAL OBJECTS AND DATABASE IN DESIGN Algirdas

• Количество слайдов: 19

PROGRAMMING GRAPHICAL OBJECTS AND DATABASE IN DESIGN Algirdas Sokas Department of Engineering Graphics Vilnius Gediminas Technical University

Faculty of Fundamental Sciences bachelor study programs § Bioengineering § Engineering Informatics § Technomathematics 2

Master study programs § Bioengineering § Engineering Informatics Applied Informatic, Computerising of Physical and Technical Investigations, Information Systems. § Information Technology Data Mining Technology, Engineering and Computer Graphics, Spatial Information Systems. § Applied Statistics § Ecology of Technosphere 3

Students 4

Scientist of mathematic Edgar Frank Codd from IBM created first relational database model in 1969. 5

First version of Auto. CAD was created by John Walker and Dan Drake in 1982. They founded , , AUTODESK”. 6

Formulation of problem Prepare methods, algorithms and procedures for solving these design problems: l Attach information from database to a graphical object being drawn; l Read information from certain graphical objects of a drawing and collect, store and present this information in database. 7

8

Data exchange technology Open database connectivity (ODBC) technology (1991). Object linking and embedding database (OLE DB) technology (1996). Modern technology is Active. X (1996). 9

Algorithms Form an algorithm to attach database record information to graphical object: 1. Select one graphical object record in the database; 2. Create extended data of new graphical object; 3. Draw programming graphical depending object on extended data and scale in the drawing. Form algorithm to read the information from graphical objects and to collect extended data in the database records: 1. Select k graphical objects in the drawing; 2. Take first object from beginning; 3. Verify whether object has extended data; If does not have, go to position 2; if has, go to position 4; 4. Collect extended data in the database record. 10

Programming with objects from database We have to create an instance of the application and to declare a variables that will represent the other application: Dim cc As ADODB. Connection (1) Dim rr As ADODB. Recordset (2) Second, we have to create a set of statements with declared variables: Set cc = New ADODB. Connection (3) With cc (4). Provider = "Microsoft. Jet. OLEDB. 4. 0" (5). Open "C: My Documents dbac 2. mdb" (6) End With (7) Set rr = New ADODB. Recordset (8) 11

Database table and drawing information 12

We can select one graphical object record in the database of graphical object parameters 13

Procedure fragment to select one graphical object record in the database rr. Open "Lentele 1", cc, ad. Open. Keyset, ad. Lock. Batch. Optimistic (9) List. Box 1. Clear (10) Do Until rr. EOF (11) List. Box 1. Add. Item rr(0) & " " & rr(1) & " " & rr(2) _ & " " & rr(3) & " " & rr(4) rr. Move. Next Loop (12) (13) (14) 14

The next procedure selecting one graphical object record with 5 fields in the database of graphical object parameters and creating extended data of new graphical objects Dim Data. Type(0 To 1) As Integer Dim Data(0 To 1) As Variant Funkcija. Langas Text. Box 2, Text. Box 3, o. Langas If o. Langas. Object. Name = "Ac. Db. Polyline" Then Data. Type(0) = 1001: Data(0) = "Lango. Data" Data. Type(1) = 1000 Data(1) = Text. Box 1 & "; " & CStr(Text. Box 2)& _ "; " & CStr(Text. Box 3) & "; " & Text. Box 4 o. Langas. Set. XData. Type, Data End If (15) (16) (17) (18) (19) (20) (21) (22) (23) 15

Collect Drawing Information In The Database For j = 1 To maxrecord rr 2. Add. New rr 2. Fields("Code"). Value = “L” & j rr 2. Fields("Name"). Value = MM(j, 1) rr 2. Fields("Count"). Value = MM(j, 2) rr 2. Update Next j (24) (25) (26) (27) (28) (29) (30) 16

Analysis of procedures PC Pentium III, 600 MHz, RAM 200 MB 17

Example. The house windows 18

Conclusions Prepare methods, algorithms and procedures for solving these design problems: attach information from database to a graphical object being drawn, reading information from certain graphical objects of a drawing and collecting, storing, presenting this information in database formats, fulfilling mathematical operations with read information. Form an algorithm to attach database record information to graphical object. Form algorithm to read the information from graphical objects and to collect extended data in the database records. The following are presented: procedure fragments and results dependent on selected record in the database of graphical object parameters; creation of extended data for new graphical object; and information transfer to another database. How the prepared procedures work that collect drawing information in the database with different number of graphical objects and without sorting procedure. Prepare example house facade drawing and database with windows information with program written in VBA language. 19