Revit Secondary Development Project Coordinate Extraction Error Using Projection to Face
Today when writing code used face.Project node to get projection point, to realize attachment function to sloped face by modifying point. Did not find problem when using this node before. Today when testing if offset target to a very low point, using same projection to face node, finally caused a relatively large error. (If it is my own node usage error, hope to leave message to remind -.-!).

Can see situation of two column caps offset. Under a relatively large offset, protecting upward will cause relatively large error in target offset value. Through several groups of simple tests found that the larger the distance, the more the final error. Before adjusting column cap was tested under a situation where slab slope is small and distance is small, no problem was found.
Through manual calculation, under sloped face situation, target adjustment within 150mm from top face is accurate. Planar value does not affect.
In order to get relatively accurate adjustment, finally adopted ray intersection method, through
public ReferenceIntersector(
ElementFilter filter,
FindReferenceTarget targetType,
View3D view3d
)
Can realize precise capture of point. Because I want to adjust to top face, so if target is below and project upward, need to consider top slab thickness. First face of ray intersection is bottom face. If not considering thickness variable, finally will become close to slab bottom. Causing error!
Reprint please indicate source.




