Landxml file into Revit issue

First of all, sorry for poking this old topic but it is the most relevant one regarding importing LandXML to Revit as Topographysurface.

In the Revit API 2020, a new TopographySurface create method is introduced. It was not availabe in previous API releases. It takes a list of points and a list of facets as input. The same input for the node “Mesh.ByPointsFacesIndices”.

There is no corresponding command for this method in Revit interface, or there is I am not aware of. This method simply does what @jostein_olsen workflow odes, great work @jostein_olsen .

There are two main issues that need to be considered:

  1. Valid Face sets.
  2. Points need to be distinct.

The valid face sets mean that the list of indices (LandXML ids) creating the face sets must match the indices of the points. This is not the case since Dynamo (my script at least) will read the XMLfile, take the list of faces and points, the points are stoired in a list starting from index zero. The ids in LandXML are not always sequential, they may start at 2 for example and miss a couple of ids (numbers) arbitrarly. I have solved this problem by using a dictionary and re-creating the face sets list.

The second problem I could not find a fix yet, but it this only happens with a very dense list of points, more than 300k, where points are not identical but very close to each others.

@Mike_Tuter for example, your file would look like this:

@ilja.prinz, I also tried your two files and got the following results. I do not know why it seems very different from your Civil3D mesh. It is the same result as in

  1. LandXML_File.txt

2.Surfaces.txt