I am trying to get distance between two points.
To get one point, I used Raybounce node and my target surface was topography model.
The problem was raybounce nodes(OOTB, custom package) could not recognise the topo model.
Of course, I can transform the topo model to polysurface and use project function.
However, It takes too much time compared to process using the raybounce node.
Is it limitation of raybounce node or my fault?
Are you trying to get the shortest distance to a topo surface from a given point above or below it?
Yes, If i can find the shortest distance from a given point. I could get a point on topo surface.
But ray bounce node is not working properly, and project node takes long processing time.
Did you get any solution on this?
Are you have this topology as a tin surface in civi 3d? Or only is it topology in revit?
It is dwg linked as topography.
Please check the snip.
if you have two point , it is easy to can get distance by use
DistanceTo to do this :
A.DistanceTo(B).ToString().ShowMessageBox("Distance A To B");
// Change A To New Location With Y
XYZ add = A.Add(new XYZ(0, 10, 0));
add.ShowMessageBox("New A"); // XYZ(0,10,0)
add.DistanceTo(B).ToString().ShowMessageBox("Distance A New To B");
XYZ p1 = UIDoc.Selection.PickPoint(ObjectSnapTypes.None);
XYZ p2 = UIDoc.Selection.PickPoint(ObjectSnapTypes.None);
double distanceTo = p1.DistanceTo(p2);
distanceTo.ToString().ShowMessageBox("Distance From P1 To P2");
// Distance FamilyInstance A To Family Instance B
Reference r = UIDoc.Selection.PickObject(ObjectType.Element,"Pick Family 1");
FamilyInstance fam1 = Doc.GetElement(r) as FamilyInstance;
LocationPoint lcp = fam1.Location as LocationPoint;
XYZ P1Fam = lcp.Point;
P1Fam.ShowMessageBox("Point Family 1");
// TODO : Code Here
Hi Ho Van,
Actually i’m trying to automatically make rock bolts for tunnel.
So from tunnel points, it should reach the topo linked surface and stop.
Hence I’m not sure if it will solve my purpose with two points.
Rather should I import the topo file in my current project?
I still confuse with your issue, In revit API, you can try with Ray intersect to find it
public static Autodesk.Revit.DB.XYZ RayIntersect(this Autodesk.Revit.DB.Element element, List<string> categories, XYZ direction)
// Find a 3D view to use for the ReferenceIntersector constructor
FilteredElementCollector collector = new FilteredElementCollector(element.Document);
Func<View3D, bool> isNotTemplate = v3 => !(v3.IsTemplate);
View3D view3D = collector.OfClass(typeof(View3D)).Cast<View3D>().First<View3D>(isNotTemplate);
// Use the center of the skylight bounding box as the start point.
BoundingBoxXYZ box = element.get_BoundingBox(view3D);
XYZ center = box.Min.Add(box.Max).Multiply(0.5);
// Project in the negative Z direction down to the ceiling.
ElementFilter elementFilter = element.Document.FiltersElementByCategory(categories);
ReferenceIntersector refIntersector = new ReferenceIntersector(elementFilter, FindReferenceTarget.Face, view3D);
refIntersector.FindReferencesInRevitLinks = true;
ReferenceWithContext referenceWithContext = refIntersector.FindNearest(center, direction);
Reference reference = referenceWithContext?.GetReference();
If you can open the Cad file and convert it to tin surface you can use this point
import point is the point in the tunnel and the output is the point at the tin surface
Okay, will try it out right away and update here.
@sovitek thank you for your note
my package was have a conflict with Civilconnection package and i solve this problem. please test the new ver. 4.0.0
can you test the new ver. 4.0.0 to make sure i have no conflict
i will test it aloso with Dynamep
Yeps give it a take later, but last time i have the package installed many nodes from dynamep missed…and an other topic…so i will give my result in pm when i have tested…thanks
@RMohareb …seems to work now with the upgrade…cheers
EDIT soryy to fast
after restart some of dynamep nodes disappear
Without your package…
With your package
thank you for your effort.
Yes you are right, the conflict come from used the same Class name for pointCloud and List
i change it in my pakege to Point_Cloud and List_
I update the Pak. Ver 4.0.1