简体   繁体   English

如何消除 revit api 中两个玻璃墙之间的间隙

[英]How to remove gaps between two glass wallls in revit api

I am working on a project in Revit where I need to create four walls, 2 of which are basic wall and the other 2 are glass walls (glass walls are called curtain walls in revit - correct me if I am wrong please).我正在 Revit 中进行一个项目,我需要创建四堵墙,其中两堵是基本墙,另外两堵是玻璃墙(玻璃墙在 revit 中称为幕墙 - 如果我错了,请纠正我)。

I was able to achieve this, but there are some problems with the output.我能够做到这一点,但 output 存在一些问题。

输出
Following is my code:以下是我的代码:
Here I get the four points.在这里,我得到了四分。

double width = UnitUtils.ConvertToInternalUnits(2500, DisplayUnitType.DUT_MILLIMETERS); 
double depth = UnitUtils.ConvertToInternalUnits(1200, DisplayUnitType.DUT_MILLIMETERS); 

List<XYZ> corners = new List<XYZ>(4);
corners.Add(XYZ.Zero);
corners.Add(new XYZ(width, 0, 0));
corners.Add(new XYZ(width, depth, 0));
corners.Add(new XYZ(0, depth, 0));

Here I draw the wall based on the points.在这里,我根据点绘制墙壁。
here levelBottomId is the bottom level这里 levelBottomId 是底层

for (int i = 0; i < 4; ++i)
{
    Line line = Line.CreateBound(corners[i], corners[3 == i ? 0 : i + 1]);
    Wall wall = Wall.Create(doc, line, levelBottomId, false);
    //add materials to walls to create basic wall or glass wall as per condition

}

my code to create basic wall materials is as follows:我创建基本墙体材料的代码如下:

WallType walltype = wall.WallType;
var newWallType = walltype.Duplicate(wallName)
var compStruct = newWallType.GetCompoundStructure();
 var wallLayers = compStruct.GetLayers();
//add materials
compStruct.SetLayers(wallLayers);
newWallType.SetCompoundStructure(compStruct);
wall.WallType = newWallType;

my code to create glass walls is as follows:我创建玻璃墙的代码如下:

List<WallType> wallTypeList = new FilteredElementCollector(doc).OfClass(typeof(WallType)).OfType<WallType>().ToList();
WallType walltype = null;
foreach (var wt in wallTypeList)
{
    if (wt.Kind == WallKind.Curtain){
      walltype = wt;
      break;
    }
}
var newWallType = walltype.Duplicate(wallName) as WallType;
wall.WallType = newWallType;
  1. The walls touch each other leaving no gap, but there is a small gap between 2 curtain walls or between the basic wall and curtain wall.墙体相互接触不留空隙,但2个幕墙之间或基础墙与幕墙之间有一个小空隙。 How can I eliminate the gap?我怎样才能消除差距?
  2. Do I have to add another family or something as a connector between the glass wall and basic wall or between two glass walls to keep it connected.我是否必须在玻璃墙和基本墙之间或两个玻璃墙之间添加另一个家庭或其他东西作为连接器以保持连接。
  3. Is my method to create glass walls correct which might be the cause of the problem?我创建玻璃墙的方法是否正确,这可能是问题的原因?

Please research the best practices and optimal workflow to solve this problem manually in the user interface before starting to work on the programming side of things.在开始进行编程方面的工作之前,请研究最佳实践和最佳工作流程以在用户界面中手动解决此问题。

In general, if a feature is not available in the Revit product manually through the user interface, then the Revit API will not provide it either.通常,如果 Revit 产品中无法通过用户界面手动提供某项功能,则 Revit API 也不会提供该功能。

You should therefore research the optimal workflow and best practices to address your task at hand manually through the user interface first.因此,您应该研究最佳工作流程和最佳实践,以首先通过用户界面手动解决您手头的任务。

To do so, please discuss and analyse it with an experienced application engineer, product usage expert, or product support.为此,请与经验丰富的应用工程师、产品使用专家或产品支持人员讨论和分析。

Once you have got that part sorted out, it is time to step up into the programming environment.一旦你把那部分整理好,就该进入编程环境了。

Here is more advice on how to research to find a Revit API solution .以下是有关如何研究以找到 Revit API 解决方案的更多建议。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM