New Connector Request BIM 360 Model Coordination

Is it possible to pull models from BIM 360 into Speckle?

1 Like

Hi @bcall!

Connecting Speckle to BIM360 models is not a feature we currently offer, although it is technically possible to do so through Forge’s Design Automation API for Revit.

It is not in our Roadmap either, as far as I’m aware, but that doesn’t mean it won’t come eventually; specially if more community members also express their interest for it.

Meanwhile, we’d love to hear more about your use-case (and others too :raised_hands:t3: ) so we can have a better picture of what this connector would look like, and what features should it provide. Some questions that pop-up right away would be:

  • How would you use a BIM360 connector? Would you want to sync up entire models, or just parts of them?
  • Would you have a need for it being bi-directional? Meaning exporting BIM360->Speckle (potentially easier) and importing from Speckle->BIM360 (definitely the harder part)
  • I’m assuming you have some experience with BIM360, so how do you see this being configured as a user? Are there any other BIM360 add-ins you could throw as examples of “nice integrations”? :slight_smile:

Feel free to fill in with any other thoughts/wishes! :raised_hands:t3:

2 Likes

Hi @AlanRynne ,

We are looking for a really good 3D viewer that is open source for our teams. Currently, our trade partners post their models to BIM 360 by setting views to publish in Revit. We would like to be able to take those views and place them in a viewer of our own creation.

I don’t know that we need anything to “push back” into BIM 360.

2 Likes

Hi all,
To give a little more food for thought here, I have thrown in my 2c below.

In my mind, it would be great to pull down a federated bim 360 model to speckle to allow for inspection and dashboarding in gatsby or similar as seen here

Having the ability to pull down a federated model, do the carbon calculations and then interrogate it in a dashboard would be really powerful. I don’t see any need to push it back to BIM360 so a one way connector would be more than enough in the first iteration.

Cheers!

4 Likes

I agree completely with the comments above. I have been looking for a way to import federated models from navisworks to speckle.

Being able to automatically import from bim360 or ACC (whenever a new version is uploaded) would be equally welcome and a viable alternative. Similarly I would mostly be interested in dashboarding (checking level of information / parameters values). No need to upload information back to bim360 or ACC for now.

2 Likes

Thanks for the great feeback!

We definitely need to look into what is possible to do with the BIM360 API, there seems to be a way to get model properties and geometry (although only as an OBJ), so for now the best solution would be to send data directly from Speckle, if possible.

@jonathon has put out an early version of a Navis connector that could be useful too!

1 Like

Watch this space for something a little more stable than that repo, coming soon :smiley:

2 Likes

Can you parse the SVF files from BIM 360 and get the information you need? Their SVF files have an internal file that contains all the geometry (not in OBJ format) and the metadata lives in a separate internal file.

An example is there :slight_smile: , try to push all data information project from ACC 360 :

Post : https://chuongmep.com/ForgeAPI-Connect-Speckle

Code Example :

1 Like

I tried.
But for me it only says :
“No displayable objects found in object 5828554bcc7e03d5294f733438761a3c.”

1 Like

The message is correct. @chuongmep can correct me if I am wrong, but this cool example is storing Forge Project Data in a Speckle commit and not any Model geometry within it.

1 Like

Yes, it is not include with Model Geometry, problem with me now is just need to keep data first, I hope speckle can think soon about connector because many clients use BIM 360 to host model and want to explore strong platform speckle

2 Likes

New Update, still don’t know why, just is problem with mesh :melting_face: :

For any guy want try :

meshpacks.7z (2.3 MB)

string jsonRead = System.IO.File.ReadAllText(@"C:\Users\chuongho\Downloads\svf_learning\Resource\3D View\MyRoom 96822\meshpacks.json");
IMeshPack[][] meshPacks = Newtonsoft.Json.JsonConvert.DeserializeObject<IMeshPack[][]>(jsonRead);
List<ISvfMesh> ivfMeshes = new List<ISvfMesh>();
foreach (var meshPack in meshPacks)
{
    foreach (IMeshPack mesh in meshPack)
    {
        ivfMeshes.Add(mesh is ISvfMesh ? (ISvfMesh) mesh : default);
    }
}

Console.WriteLine("Numbers of MeshPacks: " + meshPacks.Length);

List<Mesh?> baseMeshes = new List<Mesh?>();
int count = 0;
foreach (var ivfMesh in ivfMeshes)
{
    Mesh? mesh = ConvertISvfMeshToMesh(ivfMesh);
    if (mesh != null) baseMeshes.Add(mesh);
    count++;
    if(count>=5) break;
}
string streamId = "db5902deb6";
Base data = new Base();
data["@baseMeshes"] = baseMeshes;
string send = await Helpers.Send(streamId, data, "test").ConfigureAwait(false);
Console.WriteLine("Done with Send");

Mesh? ConvertISvfMeshToMesh(ISvfMesh isvfMesh)
{
    if(isvfMesh.vertices == null || isvfMesh.indices == null)
        return null;
    Mesh? mesh = new Mesh();

    // Map vertices
    List<double> vertices = new List<double>();
    for (int i = 0; i < isvfMesh.vertices.Length; i++)
    {
        double vertexInFeet = isvfMesh.vertices[i];
        vertices.Add(vertexInFeet);
    }
    mesh.vertices = vertices;

    // Map faces
    List<int> faces = new List<int>();
    for (int i = 0; i < isvfMesh.indices.Length; i++)
    {
        faces.Add((int)isvfMesh.indices[i]);
    }
    mesh.faces = faces;
    return mesh;
}
/// <summary>
///  Interface to group ISvfMesh, ISvfLines and ISvfPoint
/// </summary>
public interface IMeshPack { }

/// <summary>
/// Triangular mesh data, including indices, vertices, optional normals and UVs.
/// </summary>
public struct ISvfMesh : IMeshPack
{
    public int vcount { get; set; }
    public int tcount { get; set; }
    public int uvcount { get; set; }
    public int attrs { get; set; }
    public int flags { get; set; }
    public string comment { get; set; }
    public List<ISvfUVMap> uvmaps { get; set; }
    public uint[] indices { get; set; }
    public float[] vertices { get; set; }
    public float[] normals { get; set; }
    public float[] colors { get; set; }
    public Vector3 min { get; set; }
    public Vector3 max { get; set; }
}
public struct ISvfUVMap
{
    public string name { get; set; }
    public string file { get; set; }
    public float[] uvs { get; set; }
}

Forge Model Preview:

https://forge.chuongmep.com/

2 Likes

We are working on this right now, and we are facing similar challenges to @chuongmep . It looks like the order in which the vertices are placed in the array is super important for mesh creation within Speckle. Is there documentation on surface creation rules in Speckle so we can make sure we aren’t doing horrible things to our geometry?

1 Like

We were looking at the code you referenced a few years back when you were first making the Navisworks connector @jonathon , would that work too?


    /// <summary>
    /// Given <paramref name="mesh"/>, will convert and add triangle data to <paramref name="faces"/> and <paramref name="vertices"/>
    /// </summary>
    /// <param name="mesh">The revit mesh to convert</param>
    /// <param name="faces">The faces list to add to</param>
    /// <param name="vertices">The vertices list to add to</param>
    private void ConvertMeshData(DB.Mesh mesh, List<int> faces, List<double> vertices)
    {
      int faceIndexOffset = vertices.Count / 3;

      foreach (var vert in mesh.Vertices)
      {
        var (x, y, z) = PointToSpeckle(vert);
        vertices.Add(x);
        vertices.Add(y);
        vertices.Add(z);
      }

      for (int i = 0; i < mesh.NumTriangles; i++)
      {
        var triangle = mesh.get_Triangle(i);

        faces.Add(0); // TRIANGLE flag
        faces.Add((int)triangle.get_Index(0) + faceIndexOffset);
        faces.Add((int)triangle.get_Index(1) + faceIndexOffset);
        faces.Add((int)triangle.get_Index(2) + faceIndexOffset);
      }
    }
1 Like

That snippet is a little old. The triangle flag that you reference should instead be seen as a face vertex count so instead a 3 and not a 0

By that method we support arbitrary face vertex counts … ngons

If you think you just have triangular meshes it’s a pretty straightforward map.

2 Likes