Z Coordinate from Topo

Hi All,

This is regarding extracting Z coordinate from topography, (may be I am repeating the same question, but in my situation the answer is not working from previous discussions). In short, I have gone through some of the previous discussion and tried to extract the Z coordinate from topography with the given X and Y coordinates, so that I place Revit families at right place in Z axis. I tried to get Z coordinate from the topography, but i am only able to extract only one value everywhere that is 3700 (please see image below). In simple words, I need Z coordinate of topography with the given X and Y coordinate. Can somebody help me, thanks in advance.

1 Like

Im not sure exactly what you are trying to do, but you may not need dynamo for this.

I am assuming you need the coordinates to place familys onto the topography?
You could use Dynamo to place the elements using their X and Y coordinates, and just setting the Z coordinates to “0”
Then, once the familys have been placed, inside Revit, you can select all the elements, and simply select the “Pick New Host” button and select the topography, this will move all the elements insertion point onto the topography (see image)

Hope this helps :slight_smile:

1 Like

Hi @Brown,

Thanks for your reply, yes I agree with you that option will work, but our families are not host based and they are in thousands (nearly 5 to 7K) and very complex, almost impossible to recreate them all at this stage. Let me explain you in a bit detail, I have manhole families (site category) which have already placed in the model. Now, with the new design changes in roads and topography, they shud get aligned with new Topo and roads, so I am trying to align them with the help of dynamo, hope I am clear? any suggestion in this situation would be appreciated.

@Rock_Ali

You could try this:

1 Like

Something like this?

This is using the current familys and taking their XY coordinates and projecting them onto the new Topo. You could always feed in your own points.

The issue with projecting directly onto the polysurface is that it explodes the polysurface and projects on each of the surfaces… That’s why I used the surface.thicken node in my graph .

@Mostafa_El_Ayoubi

First thanks for your reply, but I am facing issue with surface.thicken node, please see below images. In the second image, the geometry got very irregular shape, i dont know exactly whats wrong, any sugeestion?

@Alisder_Brown

Thanks for your reply also, I tried your solution also, but not working (please see below image). the point.project node showing “empty list”. any suggestion or correction in my node?

try with a smaller thickness (the default value is 1). Try 0.1 for example . (i know thi is not the cleanest of methods :slight_smile: )

@Mostafa_El_Ayoubi

script is a bit faster (may be because mesh node is selected). I tried with surface thickness to 0.1, still there is no change, any suggestion?

Converting the mesh to a Polysurface is the slowest step in the graph. You could try the “Mesh.ToPolySurface” node in spring nodes (version 100.0.1 + ). It’s multi-threaded and should perform the conversion noticeably faster. You’ll first need to extract the mesh from the topo with the “Topography.Mesh” node.

1 Like

@Rock_Ali

you could try this :

this definition gets rid of the points that are projected on unwanted surfaces from the polysurface . I hope this helps :

def projectonpolysurface(pts :var[] , poly, direction)
{
faces = poly.Surfaces();
list = {};
return = [Imperative]
	{
	for (p in pts)
		{
		for (f in faces)
			{
			proj = f.ProjectInputOnto(p,direction);
			test = f.DoesIntersect(proj);
			list = Flatten({list , List.FilterByBoolMask(proj,test)["in"]});
			};
		};
	return = list;
	};
};

@Mostafa_El_Ayoubi

Thanks for your efforts, I realy appreciate. It took me whole last night for topo to polysurface in dynamo, but after that I tried your defination still no result (can see in image, background has more protrusions) may be I am doing something wrong or the defination is not working for my topo, any more help?

Thanks in advance

.

the definition needs a 3rd input : the direction of projection. In your case is the ZAxis vector .

Also, I wrote this definition pretty fast … It will only handle a flat list of points so flatten your list before you input it . I’ll try and make it more robust in the future.

@Mostafa_El_Ayoubi

still not a change

def projectonpolysurface(pts :var[] , poly)
{
faces = poly.Surfaces();
list = {};
return = [Imperative]
	{
	for (p in pts)
		{
		for (f in faces)
			{
			proj = f.ProjectInputOnto(p,Vector.ZAxis());
			test = f.DoesIntersect(proj);
			list = Flatten({list , List.FilterByBoolMask(proj,test)["in"]});
			};
		};
	return = list;
	};
};

can you try this code ? this one has the direction already set so no need for third input

I’m not sure if it’s a dynamo version issue … I’m working on 1.1 and revit 2016.
I wrapped the definition in a node called projectontopolysurface in the package Node-Mode. Maybe you can give it a try … It works for me :slight_smile: :

@Mostafa_El_Ayoubi

I tried with your new node “projectontosurface” in the package Node-Mode, but the result is empty (please see image below). I am using dynamo 1.1.0 version and revit 2015. This time i tried with another small topography, but still not succeed to get z point, getting a bit frustration with Z point…anymore suggestion??? or if you like to give a try with my topo and data points (X and Y points), I will post them, thanks in advance

Can you drop your topo file ?

1 Like

@Mostafa_El_Ayoubi

Please find the attached topo.

TopoTest_Part.rvt (1.6 MB)

@Mostafa_El_Ayoubi

Did you give a try with the topo, please let me know the result, thanks in advance.