- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello,
I am using Jeremy's BuildingCoder method
Creator.CreateModelLine
to draw planned and actual tunnel construction axes. However, the line lengths which I pass through the API do not reflect in the GUI. For example, the vector between the last face of a tunnel ring and the centroid of the new ring, has a constant length regardless of direction, equal to half the average ring width (the rings are conical in order to traverse turns), in this case AVG_HALF_WIDTH=1,406/2. In the API it goes in thus, for example:
l_ = Creator.CreateModelLine(doc, pnt, prev_ring_face);
with
+ pnt {(-0.793852403, -1.160418839, -9.490522163)}
+ prev_ring_face {(-1.192452544, -1.739473600, -9.495266745)}
and length being
(prev_ring_face-pnt).GetLength() = 0.70300000000000018 (see debugger screenshot1 attached)
This repeats for each tunnel ring.
In the GUI, when I select one of these vectors, the following dimension appears: 0,2143 (see attached screenshot1)
I reproduced this scenario for a simple line in the X-direction from an arbitrary point (0,0,20), using the length AVG_HALF_WIDTH=1,406/2:
XYZ start_test = new XYZ(0, 0, 20);
XYZ fin_test = new XYZ(AVG_HALF_WIDTH, 0, 20);
l_ = Creator.CreateModelLine(doc, start_test, fin_test);
var oLength = (doc.GetElement(l_.Id).Location as LocationCurve).Curve.Length;
with
+ start_test {(0.000000000, 0.000000000, 20.000000000)} Autodesk.Revit.DB.XYZ
+ fin_test {(0.703000000, 0.000000000, 20.000000000)} Autodesk.Revit.DB.XYZ
and oLength = 0.703
(see screenshot2)
The result in the GUI is again 0.2143 (see screenshot2), instead of the expected 0.703 which was passed through the API.
What is the reason for this discrepancy, or what am I doing wrong?
Thanks, dirk
Solved! Go to Solution.