1 / 19

PROGRAMMING GRAPHICAL OBJECTS AND DATABASE IN DESIGN

PROGRAMMING GRAPHICAL OBJECTS AND DATABASE IN DESIGN. Algirdas Sokas Department of Engineering Graphics Vilnius Gediminas Technical University. Faculty of Fundamental Sciences bachelor study programs. B ioengineering Engineering Informatics Technomathematics. M a st e r stud y programs.

maryagarcia
Télécharger la présentation

PROGRAMMING GRAPHICAL OBJECTS AND DATABASE IN DESIGN

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


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

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

  3. Master study programs • Bioengineering • Engineering Informatics AppliedInformatic, 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

  4. Students

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

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

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

  8. Data exchange technology Open database connectivity (ODBC) technology (1991). Object linking and embedding database (OLE DB) technology (1996). Modern technology is ActiveX (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 object depending 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\ dbac2.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 "Lentele1", cc, adOpenKeyset, adLockBatchOptimistic (9) ListBox1.Clear (10) Do Until rr.EOF (11) ListBox1.AddItem rr(0) & " " & rr(1) & " " & rr(2) _ & " " & rr(3) & " " & rr(4) (12) rr.MoveNext (13) Loop (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 DataType(0 To 1) As Integer (15) Dim Data(0 To 1) As Variant (16) FunkcijaLangas TextBox2, TextBox3, oLangas (17) If oLangas.ObjectName = "AcDbPolyline" Then (18) DataType(0) = 1001: Data(0) = "LangoData" (19) DataType(1) = 1000 (20) Data(1) = TextBox1 & ";" & CStr(TextBox2)& _ ";" & CStr(TextBox3) & ";" & TextBox4 (21) oLangas.SetXData DataType, Data (22) End If (23)

  15. Collect Drawing Information In The Database For j = 1 To maxrecord (24) rr2.AddNew (25) rr2.Fields("Code").Value = “L” & j (26) rr2.Fields("Name").Value = MM(j, 1) (27) rr2.Fields("Count").Value = MM(j, 2) (28) rr2.Update (29) Next j (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 with and without sorting procedure. Prepare example house facade drawing and database with windows information with program written in VBA language.

More Related