/// <summary> /// The implementation of IExternalApplication.OnStartup() /// </summary> /// <param name="application">The Revit application.</param> /// <returns>Result.Succeeded</returns> public Result OnStartup(UIControlledApplication application) { try { // Register point cloud engines for the sample. // Predefined engine (non-randomized) IPointCloudEngine engine = new BasicPointCloudEngine(PointCloudEngineType.Predefined); PointCloudEngineRegistry.RegisterPointCloudEngine("apipc", engine, false); // Predefined engine with randomized points at the cell borders engine = new BasicPointCloudEngine(PointCloudEngineType.RandomizedPoints); PointCloudEngineRegistry.RegisterPointCloudEngine("apipcr", engine, false); // XML-based point cloud definition engine = new BasicPointCloudEngine(PointCloudEngineType.FileBased); PointCloudEngineRegistry.RegisterPointCloudEngine("xml", engine, true); // Create user interface for accessing predefined point clouds RibbonPanel panel = application.CreateRibbonPanel("Point cloud testing"); System.Reflection.Assembly assembly = System.Reflection.Assembly.GetExecutingAssembly(); panel.AddItem(new PushButtonData("AddPredefinedInstance", "Add predefined instance", assembly.Location, "Revit.SDK.Samples.CS.PointCloudEngine.AddPredefinedInstanceCommand")); panel.AddSeparator(); panel.AddItem(new PushButtonData("AddRandomizedInstance", "Add randomized instance", assembly.Location, "Revit.SDK.Samples.CS.PointCloudEngine.AddRandomizedInstanceCommand")); panel.AddSeparator(); panel.AddItem(new PushButtonData("AddTransformedInstance", "Add randomized instance\nat transform", assembly.Location, "Revit.SDK.Samples.CS.PointCloudEngine.AddTransformedInstanceCommand")); panel.AddSeparator(); panel.AddItem(new PushButtonData("SerializePointCloud", "Serialize point cloud (utility)", assembly.Location, "Revit.SDK.Samples.CS.PointCloudEngine.SerializePredefinedPointCloud")); } catch (Exception e) { TaskDialog.Show("Exception from OnStartup", e.ToString()); } return(Result.Succeeded); }
/// <summary> /// The implementation of IExternalApplication.OnStartup() /// </summary> /// <param name="application">The Revit application.</param> /// <returns>Result.Succeeded</returns> public Result OnStartup(UIControlledApplication application) { try { // Register point cloud engines for the sample. // Predefined engine (non-randomized) IPointCloudEngine engine = new BasicPointCloudEngine(PointCloudEngineType.Predefined); PointCloudEngineRegistry.RegisterPointCloudEngine("apipc", engine, false); // Predefined engine with randomized points at the cell borders engine = new BasicPointCloudEngine(PointCloudEngineType.RandomizedPoints); PointCloudEngineRegistry.RegisterPointCloudEngine("apipcr", engine, false); // XML-based point cloud definition engine = new BasicPointCloudEngine(PointCloudEngineType.FileBased); PointCloudEngineRegistry.RegisterPointCloudEngine("xml", engine, true); // Create user interface for accessing predefined point clouds RibbonPanel panel = application.CreateRibbonPanel("Point cloud testing"); System.Reflection.Assembly assembly = System.Reflection.Assembly.GetExecutingAssembly(); panel.AddItem(new PushButtonData("AddPredefinedInstance", "Add predefined instance", assembly.Location, "Revit.SDK.Samples.CS.PointCloudEngine.AddPredefinedInstanceCommand")); panel.AddSeparator(); panel.AddItem(new PushButtonData("AddRandomizedInstance", "Add randomized instance", assembly.Location, "Revit.SDK.Samples.CS.PointCloudEngine.AddRandomizedInstanceCommand")); panel.AddSeparator(); panel.AddItem(new PushButtonData("AddTransformedInstance", "Add randomized instance\nat transform", assembly.Location, "Revit.SDK.Samples.CS.PointCloudEngine.AddTransformedInstanceCommand")); panel.AddSeparator(); panel.AddItem(new PushButtonData("SerializePointCloud", "Serialize point cloud (utility)", assembly.Location, "Revit.SDK.Samples.CS.PointCloudEngine.SerializePredefinedPointCloud")); } catch (Exception e) { TaskDialog.Show("Exception from OnStartup", e.ToString()); } return Result.Succeeded; }