kuklev9797's picture
download
raw
3.77 kB
Application: ExternalResourceDBServer
Revit Platform: All
Revit Version: 2015.0
First Released For: 2015.0
Programming Language: C#
Skill Level: Medium
Category: Data Exchange
Type: ExternalApplication
Subject: Sample External Resource Server
Summary:
Demonstrates a concrete class derived from the IExternalResourceServer interface. The class simulates the provision of keynote data and Revit link models from files in a remote storage location, as well as keynote data created from a database.
Classes:
Autodesk.Revit.DB.IExternalDBApplication
Autodesk.Revit.DB.IExternalResourceServer
Autodesk.Revit.DB.IGetLocalPathForOpenCallback
Autodesk.Revit.DB.IOnLocalLinkSharedCoordinatesSavedCallback
Project Files
Application.cs
Contains the class DBApplication which inherits from interface IExternalDBApplication and implements the OnStartup and OnShutdown methods. The Sample External Resource DB Server is registered with Revit in the OnStartup method.
SampleExternalResourceDBServer.cs
Contains the SampleExternalResourceDBServer class - an implementation of the IExternalResourceServer interface.
ServerInterfaceExtensionsForRevitLinks.cs
Contains GetLinkPathForOpen and LocalLinkSharedCoordinatesSaved, which are implementations of additional external resource server interfaces - IGetLocalPathForOpenCallback and IOnLocalLinkSharedCoordinatesSavedCallback. These callback classes are required in order to support Revit links.
KeynotesDatabase.cs
Contains the KeynotesDatabase class, which is a "fake" database used to demonstrate how keynote data can be loaded into Revit from an arbitrary source, rather than a traditional text file.
Description:
This sample provides following functionalities.
-
Allows the end user to load keynote data from a "remote server location," rather than from a text file stored on a locally-accessible drive.
-
Allows the end user to link Revit models from a "remote server location," rather than from a locally-accessible drive.
Instructions:
1.
Setup
For demonstration purposes, the code sample is written assuming that the "remote server location" is actually a folder under the directory where the DLL produced by this code will reside. Consequently, be sure to copy the \SampleResourceServerRoot folder and its contents to the same directory where you put the DLL file after you build this code sample.
2.
Loading Keynote Data from the Server.
a.
Start Revit and open a model, or create a new project
b.
Open the Keynote Settings dialog (Annotate tab | Keynote button).
c.
Select Browse.
d.
In the Places bar on the left, select External Resources
pict001.wmf
e.
Select the SDK Sample Server
pict002.wmf
f.
Browse through the folders on the server and select a keynote resource to load. NOTE: To demonstrate the flexibility of the server framework, the sample detects if the user is working in the French or German culture and then directs their browsing to a simulated database. Other users browse through actual folders and files under the \SampleResourceServerRoot folder described in part 1.
g.
Click "Open" and the keynote data should load into Revit
h.
You can check the data by selecting the "View" in the Keynote Settings dialog.
3.
Link in a Revit model from the server.
a.
Start Revit and open a model, or create a new project
b.
From the project browser, or Manage Links dialog, or Insert tab, add a new Revit link
c.
Repeat steps d. and e. from part 2.
d.
Browse through the directories on the "remote server" (which are really just folders under the \SampleResourceServerRoot folder described in part 1) and select a Revit mode to link.
e.
Click "Open" and the link model should load into Revit.

Xet Storage Details

Size:
3.77 kB
·
Xet hash:
b44c60f62d46e413e795fa8b1ac9627a871114d53041825b6f68437abbc466dd

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.