Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

The method of Linear dimensioning of Multi-pipes in Revit

Shulou Source: shulou.com Published: 2022-05-31 14:22:18 10月03日 Update

Most people do not understand the knowledge points of this "Revit multi-pipeline linear labeling method" article, so the editor summarizes the following contents, detailed contents, clear steps, and has a certain reference value. I hope you can get something after reading this article. Let's take a look at this "Revit multi-pipeline linear labeling method" article.

Linear dimensions mainly provide two kinds of API:

But in fact, it is also a kind of, the second can choose the dimension style.

The three main parameters:

View

Dimensioned view

Line

Dimension line

References

Stable reference

Note here that annotation views can only be done in plan or elevation views, and the example methods in this section can only be used on linear elements.

The sample code is as follows:

Route dimensioning is relatively simple and does not require access to geometry, so using this as a reference example, the method is basically consistent.

Selection selection = uiDoc.Selection

/ / Select elements that need to be dimensioned

IList referenceList = selection.PickObjects (ObjectType.Element, "Please select elements to dimension")

If (referenceList.Count < 1)

{

TaskDialog.Show ("warning", "error selecting quantity, please reselect")

}

Autodesk.Revit.DB.View view = doc.ActiveView

ViewType vt = view.ViewType

If (vt = = ViewType.FloorPlan | | vt = = ViewType.Elevation)

{

/ / get one of the elements to get its location

Element element = doc.GetElement (referenceList.ElementAt (0))

Line line = (element.Location as LocationCurve) .Curve as Line

Element element2 = doc.GetElement (referenceList.ElementAt (1))

Line line2 = (element2.Location as LocationCurve) .Curve as Line

XYZ linemiddle = line.Evaluate (0.5, true)

/ / projects the intersection of a specified point on this line

XYZ projectPoint = line2.Project (linemiddle) .XYZPoint

Line newLine = Line.CreateBound (linemiddle, projectPoint)

ReferenceArray references = new ReferenceArray ()

Foreach (Reference reference in referenceList)

{

References.Append (reference)

}

/ / call the method of creating dimensions to create

Dimension autoDimension = doc.Create.NewDimension (view, newLine, references)

}

Else

{

TaskDialog.Show ("warning", "Annotation view is not a plan view or elevation view")

}

Let's take a look at the effect:

Before labeling

Select the pipe to be labeled

The finished effect of dimensioning

The above is about the content of this article on "Revit multi-channel linear annotation method". I believe we all have a certain understanding. I hope the content shared by the editor will be helpful to you. If you want to know more related knowledge, please pay attention to the industry information channel.

Tags: View method content selection pipe linear element example size plane effect article knowledge article consistency three no intersection code value Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno vpn MySQL NVidia Shulou Tech Info Xiaomi