Message 1 of 2
getBoundingBox in VC++
Not applicable
10-29-2017
05:49 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I am creating a Revit 2018 AddIn in VC++. I am trying to get the bounding box of the point cloud. Here's the code:
Autodesk::Revit::DB::ElementCategoryFilter ^pointCloudFilter = gcnew Autodesk::Revit::DB::ElementCategoryFilter(Autodesk::Revit::DB::BuiltInCategory::OST_PointClouds);
Autodesk::Revit::DB::FilteredElementCollector ^collector = gcnew Autodesk::Revit::DB::FilteredElementCollector(doc);
System::Collections::Generic::IList<Autodesk::Revit::DB::Element^>^ pointClouds = collector->WherePasses(pointCloudFilter)->WhereElementIsNotElementType()->ToElements();
for each(Autodesk::Revit::DB::Element^ pointCloud in pointClouds) {
Autodesk::Revit::DB::PointCloudInstance^ pointCloudInstance = dynamic_cast<Autodesk::Revit::DB::PointCloudInstance ^>(pointCloud);
pointCloudInstance->getBoundingBox(nullptr);
}While building, I get the error:
Error C3767 'Autodesk::Revit::DB::Element::getBoundingBox': candidate function(s) not accessible RevitCppAddIn E:\RevitCppAddIn\RevitCppAddIn\RevitCppAddIn.cpp 20
It seems that the method "getBoundingBox()" is protected. You can see it in the following screenshot as well.
Is this a bug or is there any other way to get bounding box of a PointCloudInstance?
Note that the method "get_BoundingBox()" is public and works in C#.