dylim
July 29, 2020, 1:46am
1
Hi guys.
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?
Thanks!
Are you trying to get the shortest distance to a topo surface from a given point above or below it?
dylim
July 29, 2020, 6:49am
3
Hi @harilalmn .
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.
Hi Dylim,
Did you get any solution on this?
Regards,
ap
Are you have this topology as a tin surface in civi 3d? Or only is it topology in revit?
Hi Ramiz,
It is dwg linked as topography.
Please check the snip.
Regards,
ap
1 Like
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");
//Practical
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
2 Likes
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?
Regards,
ap
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();
return reference?.GlobalPoint;
3 Likes
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
4 Likes
Okay, will try it out right away and update here.
Thank you.
ap
1 Like
sovitek
January 24, 2023, 3:16pm
12
2 Likes
@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
regards:
can you test the new ver. 4.0.0 to make sure i have no conflict
i will test it aloso with Dynamep
2 Likes
sovitek
January 24, 2023, 3:53pm
14
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
2 Likes
sovitek
January 25, 2023, 8:00am
16
Great @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
1 Like
@sovitek
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
1 Like
Hello all,
Again opening this thread with my previous tries.
I’ve tried ray bounce with Civil3d tin surface import in revit (not linked)
and Created topo in revit itself, but ray bounce doesn’t detect both.
Any reason to it?
Regards,
Atharva Purohit