2025-04-24 20:56:44 +08:00
|
|
|
|
using Autodesk.Revit.Attributes;
|
2025-02-10 20:53:40 +08:00
|
|
|
|
using Autodesk.Revit.DB;
|
|
|
|
|
|
using Autodesk.Revit.UI;
|
|
|
|
|
|
using Autodesk.Revit.UI.Selection;
|
|
|
|
|
|
|
|
|
|
|
|
using Nice3point.Revit.Toolkit.External;
|
2025-04-24 20:56:44 +08:00
|
|
|
|
using ShrlAlgoToolkit.Revit.Assists;
|
|
|
|
|
|
using ShrlAlgoToolkit.Revit.Extensions;
|
2025-02-10 20:53:40 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
namespace ShrlAlgo.Addin.Test;
|
|
|
|
|
|
[Transaction(TransactionMode.Manual)]
|
|
|
|
|
|
[Regeneration(RegenerationOption.Manual)]
|
|
|
|
|
|
public class AddWallTypeParam : ExternalCommand
|
|
|
|
|
|
{
|
|
|
|
|
|
public override void Execute()
|
|
|
|
|
|
{
|
|
|
|
|
|
Document.Invoke(
|
|
|
|
|
|
ts =>
|
|
|
|
|
|
{
|
|
|
|
|
|
var file = ParameterAssist.OpenSharedParametersFile(Application);
|
|
|
|
|
|
var group = file.Groups.get_Item("Atkore");
|
|
|
|
|
|
var definition = group.Definitions.get_Item("test");
|
|
|
|
|
|
var categories = Application.Create.NewCategorySet();
|
|
|
|
|
|
categories.Insert(Category.GetCategory(Document, BuiltInCategory.OST_Walls));
|
|
|
|
|
|
var newIB = Application.Create.NewTypeBinding(categories);
|
|
|
|
|
|
var b = Document.ParameterBindings.ReInsert(definition, newIB);
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|