首先给构件族创建一个材质参数,然后让族的材质使用该参数,即可直接用参数化的过程改变材质

创建某颜色的材质

class MaterialColor
{
    public Material materialTest;
    public Document document;
public MaterialColor(Document document) => this.document = documentpublic void AddColor() { Transaction transaction = new Transaction(document); transaction.Start("改变颜色"); materialTest = document.GetElement(Material.Create(document, "测试材质")) as Material; //创建材质 materialTest.Color = new Color(255, 255, 0); //更改颜色 transaction.Commit(); } }

然后直接将创建的新的Material赋予参数即可

 

相关文章:

  • 2022-01-08
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-09-22
  • 2021-12-18
  • 2021-06-16
猜你喜欢
  • 2021-10-09
  • 2022-12-23
  • 2021-09-11
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-09-30
相关资源
相似解决方案