我想在从 revit 绘制管道时以编程方式将用于创建管道的指针从一个地方移动到另一个地方。
请参考下图。
从 revit 绘制管道时,我可以更改偏移量(例如从 15 到 16)。但无法以编程方式将创建管道指针位置从红点更改为橙色点(参考图片)。
这可能吗?
或者
我们可以在从 Revit 绘制管道时以编程方式更改或访问偏移值吗?
参考下图
请建议..
问候
纳米特耆那教
我想在从 revit 绘制管道时以编程方式将用于创建管道的指针从一个地方移动到另一个地方。
请参考下图。
从 revit 绘制管道时,我可以更改偏移量(例如从 15 到 16)。但无法以编程方式将创建管道指针位置从红点更改为橙色点(参考图片)。
这可能吗?
或者
我们可以在从 Revit 绘制管道时以编程方式更改或访问偏移值吗?
参考下图
请建议..
问候
纳米特耆那教
通过Autodesk.Revit.DB.Plumbing
命名空间:有一个功能:
public static Pipe Create(Document document, ElementId systemTypeId, ElementId pipeTypeId, ElementId levelId, XYZ startPoint, XYZ endPoint);
您可以在代码中使用它,例如:
XYZ fStartPoint = new XYZ(0.0, 0.0, 0.0); //Modify these values to your desired coordinates
XYZ fEndPoint = new XYZ(0.0, 0.0, 0.0); //Modify these values to your desired coordinates
ElementId pPipeTypeId = pPreviousPipe.PipeType.Id;
ElementId pPipeLevelId = pPreviousPipe.LevelId;
ElementId pSystemId = pPreviousPipe.MEPSystem.Id;
if (pPipeLevelId == ElementId.InvalidElementId)
{
Level lLevel = null;
using (Transaction pTrans = new Transaction(doc, "Get Level"))
{
pTrans.Start();
lLevel = Level.Create(doc, pPreviousPipe.LevelOffset;
pTrans.Commit();
}
pPipeLevelId = lLevel.Id;
}
Pipe.Create(doc, pSystemId, pPipeTypeId, pPipeLevelId, fStartPoint, fEndPoint);
该函数有重载Create(...)
,所以也看看这些。如果您要连接Pipe
s 和FamilyInstance
s 之类的配件,您可以使用
public static Pipe Create(Document document, ElementId pipeTypeId, ElementId levelId, Connector startConnector, Connector endConnector);
Connector
这将通过s直接连接它们。至于抵消管道,我上面所做的应该最适合你。祝你好运!
第二Offset
张图片中的 是指Z
飞机的轴。你想做一些更像
var fTemp = pPreviousPipe.Location as LocationCurve;
var fEnd = fTemp.Curve.GetEndPoint(1);
//Index 0 is the beginning of the pipe (where user started drawing)
//Index 1 is the end of the pipe (where user stopped drawing)
XYZ fStartPoint = new XYZ(fEnd.X, fEnd.Y - .5, fEnd.Z);
double dPipeLength = 10.0;
XYZ fEndPoint = new XYZ(fStartPoint.X + dPipeLength, fStartPoint.Y, fStartPoint.Z);