Analytical Node Vs Analytical Member Coordinate Accuracy Issue
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Frustratingly - there is no direct way to get the Analytical Node Ids from an Analytical Member (it really seems like in the API there should be some really simple method like AnalyticalMember.EndNode(int) where you could get the Analytical Node that is at the i and j ends of an Analytical Member). There is the Hub Connection Manager available for Analytical Nodes that makes getting the Analytical Members associated to a Node pretty direct, but there isn't the inverse to go from Member to Node, and even with the Hub Connection Manager - you cannot tell whether a particular Node is at the i or j end of a member (Note that when you might have 30,000 Analytical Members and 45,000 Analytical Nodes - its not really efficient to have to query all 45,000 Nodes to then query their Hub Connection Manager just to find which two nodes belong to a particular member). Bottom line - you end up needing to do some geometric comparisons at some point taking the AnalyticalNode.Position (AnalyticalNodes are Reference Points) and then also taking the AnalyticalMember geometry line and getting the end points - then finding where the ReferencePoint XYZ coordinates match the EndPoint XYZ coordinates.
In the process of doing this, I've come across a puzzling inconsistency with the new Analytical Members vs Analytical Nodes. It seems that somewhere in the guts of Revit - the geometry curve end point coordinates that get reported get mysteriously rounded, but the ReferencePoint coordinates do not. See image below - clearly the AnalyticalNode ReferencePoint X Coordinate is 100.000002115674, but somehow the AnalyticalMember Line.EndPoint(0) sees it's X coordinate as 100.000000000. I'm no expert - but that seems bad to me even though it's very small numbers, any operation looking for A==B is not going to have any success unless someone knew ahead of time that they needed to go on and round down to 5 decimal places before doing a comparison.
If anyone (specifically anyone who works at Autodesk and wants to investigate and/or fix this) wants to check it out - the small file below has some Analytical Members in it with this exact problem with coordinate rounding. I'd still like to have a direct method to find which Nodes belong to a selected member, but with current capabilities the geometric comparisions seem to be the best route, but the coordinate rounding accuracy makes this a little weird. Note that this also makes for some head scratching when nodes show themselves as "Unconnected" but when looking at the geometry of the Analytical Members everything points to things should be connected (because the member geometry reported doest match the node coordinates in the model)