using Autodesk.Revit.Attributes;
using Autodesk.Revit.DB;
using Autodesk.Revit.DB.Structure;
using Autodesk.Revit.UI;
using Autodesk.Revit.UI.Selection;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
namespace Boolean
{
[Transaction(TransactionMode.Manual)]
public class Difference : IExternalCommand
{
public Result Execute(ExternalCommandData commandData, ref string message, ElementSet elementSet)
{
Document doc = commandData.Application.ActiveUIDocument.Document;
UIDocument uidoc = commandData.Application.ActiveUIDocument;
Selection choices = uidoc.Selection;
///获得选中构件的图元(族实例)
TaskDialog.Show("Revit", "chose one solid");
Reference solid00 = choices.PickObject(ObjectType.Element);
Element element0 = doc.GetElement(solid00);
Solid solid0 = El
Revit二次开发——布尔运算Difference(代码)
最新推荐文章于 2023-03-26 15:38:46 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)