Quantcast
Channel: All Revit API Forum posts
Viewing all articles
Browse latest Browse all 67020

Re: Pointcloud section box

$
0
0

Hi,

 

You must call the void PromptForPointCloudSelection wuth good arguments :

Check this :

 

public Result Execute(ExternalCommandData commandData, ref string message, ElementSet elements)
{

        UIApplication uiApp = commandData.Application;
        UIDocument uiDoc = uiApp.ActiveUIDocument;
        Autodesk.Revit.ApplicationServices.Application app = uiApp.Application;
        Document doc = uiDoc.Document;
        Selection currentSel = uiDoc.Selection;

 

        //Define a Reference object to accept the pick result.
        Reference pickedRef = null;

        //Pick a point cloud instance
        Selection sel = uiApp.ActiveUIDocument.Selection;
        pickedRef = sel.PickObject(ObjectType.Element, "Select a point cloud instance");
        Element elem = doc.GetElement(pickedRef);

        //Test if point cloud instance is selected
        if (elem.Category.Id.IntegerValue != (int)BuiltInCategory.OST_PointClouds)
        {
            TaskDialog.Show("Revit", "Please select a point cloud instance !");
            return null;
        }
        else
        {
            PointCloudInstance my_pci = elem as PointCloudInstance;
            PromptForPointCloudSelection (uiDoc , my_pci)
        }

}


Viewing all articles
Browse latest Browse all 67020
<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>