1 / 73

Revit API Techniques for Managing Building Data

Revit API Techniques for Managing Building Data. Mario Guttman. Code Examples in C#. Introduction to Building Data - 1. Introduction to Building Data - 2. Commercial Products Affinity ( Trelligence ) Onuma Planning System CodeBook dRofus ( Nosyko ). Introduction to Building Data - 3.

ray
Download Presentation

Revit API Techniques for Managing Building Data

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. Revit API TechniquesforManaging Building Data Mario Guttman

  2. Code Examples in C#

  3. Introduction to Building Data - 1

  4. Introduction to Building Data - 2 Commercial Products Affinity (Trelligence) Onuma Planning System CodeBook dRofus (Nosyko)

  5. Introduction to Building Data - 3 WhiteFeet RevitDbLink Ribbon Menu and Connection Screen for RevitDbLink Tool

  6. Revit API Customization Visual Studio RestoringSettings Quick Select Buttons Visual Studio Integrated Development Environment (IDE)

  7. Structuring Data – 1Relational Database Design Tables Rows and Columns Keys Primary Foreign Relationships One-to-Many Referential Integrity Normalizing Data Access Objects and Relationships

  8. Relational Database Relationship Table Table

  9. Table Columns (Fields) Rows (Records) Room Table

  10. Primary Key Field • A Primary Key Field uniquely identifies a record. • It must be: • Not Null • Unique Room Table

  11. Foreign Key • A Foreign KeyField • Points to the Primary Key of another table. • May be Null. • May be a Primary Key. Floor Table Room Table

  12. One-to-Many Relationship • A One-to-many Relationship is defined by a Foreign Key. • A value can only occur once on the “one” side. • A value may occur many times on the “many side. 1  Floor Table Room Table

  13. Referential Integrity • Referential Integrity requires that the “one” side exist before the “many” side is used. • Changes can be cascaded from the one to the many. • Deletions can cascade, but will delete the whole record. 1  Floor Table Cannot use value “Floor 04” here. Room Table

  14. Normalizing Data A table is Not Normalized If it has redundant data. Contact Table with Office Addresses The data can be Normalized by using two tables.  1 Office Table Contact Table

  15. Structuring Data - 2 Formalizing theSpace Program Data From Client Formatted visually. Excel or hard-copy. ProgramCharacteristics Room Types. Organizational Uses. Space Program Type – Use Pairs. Count each. SpaceProgram

  16. Rooms Each room instance. Type – Use that room. Room List with Types and Uses

  17. DATA TABLE: • SPACE NEEDS • TYPE OF ROOM • WHO IS USING IT • HOW MANY OF EACH • DOCUMENT: • READABLE FORMAT • UNSTRUCTURED DATA CLIENT REQUIREMENTS (EXCEL WORKSHEET) SPACE PROGRAM (ACCESS TABLE)

  18. DATA TABLE: • INDIVIDUAL ROOMS • TYPE OF ROOM • WHO IS USING IT • ROOM OBJECTS: • GEOMETRY • DATA ATTRIBUTES ROOM LIST (ACCESS TABLE) BIM MODEL (REVIT PROJECT)

  19. Linking Revit to a Database - 1 Using Access and Revit Windows Memory Space Revit: 64-bit. Access: 32-bit. Connection OLE: ACE (JET) Drivers. COM: Interop Mode. ACE Pass-through Service Service TCP-IP interface. 32-BIT ACCESS OLE – ACE DRIVER SERVICE – ACE PASS-THROUGH TCP/IP PROTOCOL 64-BIT REVIT ACE Pass-through Service

  20. Linking Revit to a Database - 2 RevitDbLink Overview The “Link” The “Link” is actually a logical relationship, based on conventions in both programs.

  21. Linking Revit to a Database - 3 RevitDbLink Overview Main Menu Synchronization Menu The Main Menu (left) is used to select the link and query data. The results are shown on the Synchronization Menu (right), where discrepancies can be resolved.

  22. Code Example 1 Working with Data Linking to a Database Access. SQL Server. Using Excel Data Objects in C# Database Tables - Named Columns Excel Worksheet – Fields in First Row

  23. CREATING A DATABASE CONNECTION Set connection type. Build connection string. Create connection.

  24. Make Data Objects. • Define: • Primary Key. • Update/Delete Commands. Work with data. Update database

  25. CONNECTING TO EXCEL Define Excel objects. • Link to Excel Session: • Start new session. • “Bind” to existing or start new session.

  26. HIDING EXCEL APPLICATION Define “ShowWindow” call to Windows. Apply it to every “Excel” process Use minimize option.

  27. WORKING WITH EXCEL WORKSHEETS Get a list of existing worksheets. • Use a Worksheet: • Existing. • New.

  28. Define C# data objects. Use the first row of the Excel worksheet to create columns in the data table.

  29. For the remaining rows in Excel: • Get a row from Excel. • Make a row in the data table. • For each column in Excel: • Get the Excel value. • Set the row value. Add the row to the data table.

  30. WORKING WITH DATA IN C# Create a data table. Add columns. Create a new row. Work with the rows.

  31. Creating Areas and Solid Forms - 1 AbstractingMajor Spaces Major Planning Groups Space Requirements Classification Planning Groups Derived from Space Program

  32. Creating Areas and Solid Forms - 2 Importing Areas Unplaced Areas Parameters Key Value. Descriptive Name. Classification Required Area Floor Revit Schedule Place Unplaced Areas Menu

  33. Creating Areas and Solid Forms - 3 Placing Areas Area Boundary Lines Shape Squares. Modular Rectangle. Classification Color Areas Placed as Squares and using a Planning Module

  34. Creating Areas and Solid Forms - 4 Parti Site Constraints Plan Dimensions Number of Floors Floor Heights Building Geometry Constraints

  35. Creating Areas and Solid Forms - 5 Manipulating Areas Areas Moved to Plan Locations

  36. Creating Areas and Solid Forms - 6 Converting Areasto Solid Forms Standard Block Shape Area extremities. Height, Width, Depth. Extruded Boundary Area boundary. Fixed Height Areas Converted to Solid Forms

  37. Creating Areas and Solid Forms - 7 Basic Area and Massing Diagram

  38. Code Example 2 Making Solids Based On Areas. Rooms. Family Standard Rectangle. Extrusion. Setting Material Solid Families Made From Areas and Rooms

  39. MAKING SOLID SHAPE FROM ROOM Use an existing room. Create a new family. Make a new material.

  40. OPTION 1: A PRE-DEFINED RECTANGULAR SOLID Get the location and dimensions of the room. Create a family instance. Adjust dimensions. Set material.

  41. OPTION 2: A UNIQUE FAMILY USING AN EXTRUSION • Get room shape: • Room boundary: list of curves. • Each curve: list of segments. • Create CurveArrays. • Build CurveArrArray.

  42. Create new family. Add extrusion of CurveArrArray. Get or make a subcategory.

  43. BOTH OPTIONS: APPLY MATERIAL AND SAVE FAMILY Apply the material to the subcategory. Save the Family to a file.

  44. BOTH OPTIONS: MAKE AN INSTANCE OF FAMILY • Load the new family: • Use the saved file. • Delete the file. Get the family symbol. • Create a new instance: • Use family symbol. • Location (0, 0, 0).

  45. BOTH OPTIONS: TRANSFER PARAMETER VALUES • Get the parameters: • Room – Source. • Family – Target. • Transfer values: • Get source value. • Convert data type. • Set target value.

  46. Creating Rooms - 1

  47. Creating Rooms - 2 Computing RoomsfromProgram Database Rooms in Access

  48. Creating Rooms - 3 ImportingUnplaced Rooms Unplaced Rooms in Revit

  49. Placing Rooms Array of Squares Tagged Moved to Plan Creating Rooms - 4 Rooms Placed in an Array and then Moved to the Plan

  50. Creating Rooms - 5 Validating Program with Database Discrepancy No Database Record. No Model Element. Unequal Values. Actions No Action. Update Model. Update Database. Synchronization of the Model and the Database

More Related