Sie sind auf Seite 1von 4

Point Cloud Indexer Plugin API

Summary
Revit 2012 supports linking point cloud data into a Revit project and displaying this data to assist in creating a Building Information Model. To display point cloud data in Revit the supplied point cloud file must !e in a format that Revit can understand. "oint #loud data is stored in an inde$ed format %."#&' that Revit and other (utodesk products can read parse and display. To support other )rd party scanned ra* data formats Revit +inde$es, or converts those formats to the "#& format that Revit can display and manipulate. The inde$ing consists of a standalone e$ecuta!le that is launched from Revit *hen a format or +codec, other than "#& is selected. The inde$ing process converts the data into the "#& format.

The inde$er ships *ith support for inde$ing the follo*ing formats or +codecs-, 1. .eica 2. /aro ). .las codec 0. .12B codec 3. .124 codec 5. .pts codec

Extending the Indexer


The inde$er can !e e$tended to support additional codecs6file formats !y creating a plugin for the inde$er.

Inde$er plugins consist of a 7.. file placed in the follo*ing location-

[folder where revit.exe resides]8"lugins8"oint #louds #odecs

The plugin must implement the follo*ing classes and ("Is-

Class IIndexerPlugin This is the +entry, point for the inde$er into the plugin. This simple interface class has the follo*ing methods1. const *char9t: get#odecs- Returns a semi;colon delimited list of +codecs, or file e$tensions the inde$er supports %for e$ample- +.e$t1<.e$t2,'. 2. #odec/ileReader: get/ileReader%const *char9t: codec'- &iven a codec returns the reader for that codec that the plugin provides. =ee !elo* for more information on the Reader implementation. ). Bool canImport%const *char9t: input/ile'- &iven a file name6path returns true if the plugin is a!le to import6support the specified file6codec. Typically this involves looking at the e$tension !ut could involve opening and parsing header information etc. for further validation. 0. destroy- #alled *hen the inde$er is completed *ith the plugin and it is safe to release resources6memory. (ccess to the implementation of this class is via a +#, style ("I that M>=T B? implemented and e$ported !y the dllIInde$er"lugin: getInde$er"lugin%'<

Class CodecFileReader The core of the plugin *ork is done !y the #odec/ileReader. The #odec/ileReader parses the data from the codec and returns the various points for conversion into the format supported !y Revit. The reader implements the follo*ing methods1. Bool open %const *char9t: inputfile'- @pens the specified file for processing. Returns true if the file is opened and reada!le false other*ise. 2. close%'- #loses the opened file.

). /ilestats%dou!le: min"ts dou!le: ma$"ts long longA numpoints'- #ollects the stats for the file if the file *as successfully opened and sets the data as follo*sa. min"tsB0C to the minimum $;value of all points in the file !. min"tsB1C to minimum y;value of all points in the file c. min"tsB2C to minimum D;value of all points in the file d. ma$"tsB0C ma$"tsB1C ma$"tsB2C to the ma$imum $ y D of all points in file e. num"oints to total num!er of points in the file 0. The follo*ing methods seEuentially read all valid points in the file returning false *hen no more points remain. If the point isnFt classified then the classification is set to 0$ff. If the point does not have intensity then the intensity is set to ;1a. Bool read/irst"oint%dou!leA $ dou!leA y dou!leA D unsigned charA red unsigned charA green unsigned charA !lue unsigned charA classification floatA intensity' !. Bool readGe$t"oint%dou!leA $ dou!leA y dou!leAD unsigned charA red unsigned charA green unsigned charA !lue unsigned charA classification floatA intensity' Use of the Interfaces The Inde$er uses the follo*ing seEuencing *hen *orking *ith a plugin-

1. The plugin is loaded dynamically and an instance of the plugin interface is retrieved !y calling the getInde$er"lugin e$ported from the plugin implementation dll. 2. Hhen a file is to !e inde$ed the IInde$er"lugin interface is called to verify it +canIMport, the file in Euestion and if so the codec is passed to retrieve the associated #odec/ileReader from the plugin. ). The #odec/ileReader is then called to open the file. 0. If the open is successful the #odec/ileReader is called to collect file stats %for progress reporting and conversion preparation etc.'. 3. Then point !y point the #odec/ileReader is called to collect each point and store6convert it to the inde$ed format Revit supports. The result .pcg is specified as part of the inde$er launch if not specified the resulting pcg file is *ritten to the same location as the original codec file. In either case upon completion the inde$er displays the location of the inde$ed file to the user.

5. (fter processing the last point the #odec/ileReader is called to close the file. I. (fter the inde$ing is complete the IInde$er"lugin is called to destroy itself. J. The plugin is unloaded upon e$it of the Inde$ing process.

Das könnte Ihnen auch gefallen