AutoCAD Map 3D

Community Scoring

Was this page helpful?

Tag Tags0

This page has no tags

Page statistics

874 views1 edit(s)7063 characters(s) Page last modified 12:16, 10 Apr 2012 by contentconnector
How to add your knowledge

Procedure

    Table of contents
    No headers

    To use this sample:

    1. Build the sample. The plugin (VBSample53.dll or CSSample53.dll) and the associated .tbp file are copied to the AutoCAD Map 3D Client bin directory.
    2. Start AutoCAD Map 3D and open the TBSAMPLE workspace.
    3. Click the application toolbar button with the Sample 53 - Connection Tools caption. The new form is displayed.
      Note

      If you have run the sample previously (you can use Step 6 to determine if the table exists) and want to start again from the beginning, you must remove the sample_person table from the database. In an Oracle SQL*Plus session enter the following commands:

      connect tbsample/avs
      drop table sample_person cascade constraints;
      
    4. Click Create Data Structure For Sample. The handler for this button uses the Autodesk.Map.IM.Data.Tools.DataStructure class. An information dialog box is displayed with the Creating Structure text. Click OK.
    5. Verify that the table was created and determine its structure. In an Oracle SQL*Plus session, enter the following commands:
      connect tbsample/avs
      select table_name from user_tables where table_name = ‘SAMPLE_PERSON’;
      desc sample_person
      
    6. Click Write Data. The handler for this button uses the Autodesk.Map.IM.Data.Tools.RecordWriter class to set name/value pairs before performing the SQL command. An information dialog box is displayed with the There are 0 values in SAMPLE_PERSON text. Click OK.
    7. A message box is displayed with a SQL statement for an insertion into SAMPLE_PERSON. Click OK. The inserted data is displayed in the list box; the source of the data is a select on SAMPLE_PERSON. This pattern of events is repeated several times with some of the SQL statements being insertions and some being updates.
    8. Click Read Data. The handler for this button uses the Autodesk.Map.IM.Data.Tools.RecordReader class. Some data from each row in the SAMPLE_PERSON table is displayed in the list box.
    9. Click Read Array. The handler for this button uses the Autodesk.Map.IM.Data.Tools.RecordBuffer and the Autodesk.Map.IM.Data.Tools.ConnectionTools classes. A message box is displayed with the Gabi del la Blub has Size 0.58 text. Click OK.
    10. Click Save Object Properties. The handler for this button uses the Autodesk.Map.IM.Data.Tools.RecordWriter class to serialize properties extracted from an object before executing the insert SQL statement.
    11. Click Load Object Properties. The handler for this button uses the Autodesk.Map.IM.Data.Tools.RecordReader class to select a row from SAMPLE_PERSON and deserialize the properties to create an object. A message box is displayed with information extracted from the object. Click OK.
    12. Click Write SQL Loader File. The handler for this button uses the Autodesk.Map.IM.Data.Tools.SqlExport class to extract rows from SAMPLE_PERSON and write them to a file. A text editor window is displayed displaying the extracted information. Close the window.
    13. Click Read Buffer. The handler for this button uses Autodesk.Map.IM.Data.Tools.RecordReader class to select a row from SAMPLE_PERSON, uses the select results to create an object, displays two of the object’s properties in a message box, changes one of the object properties that was displayed and then uses the Autodesk.Map.IM.Data.Tools.RecordWriter class to extract the object properties and update the corresponding row in the SAMPLE_PERSON table. Finally, it displays the updated row in the list box.