Problem to create a Revit Wall

Hi community,

I’m trying to send a Revit wall but when I visualize it over Speckle Viewer it appear like a line.

Here my code

var wall = new RevitWall()
{
    family = "Mur de base",
    type = "Générique - Ext. 200 mm",
    baseLine = new Line(new Point(0, 0), new Point(10, 0)),
    units = "m",
    level = new RevitLevel
    {
        name = "RDC",
        elevation = 0,
        units = "m"
    },
    //topLevel = new Level("Niveau 1", 3000),
    height = 5,
};

var @base = new Base();
@base["elements"] = new List<RevitWall>() { wall };
@base["@types"] = new List<RevitElementType>() { 
    new RevitElementType()
    {
        family = "Mur de base",
        type = "Générique - Ext. 200 mm",
        category = "Murs"
    }
};
@base["@materials"] = new List<RevitMaterial>() { 
    new RevitMaterial("Mur par défaut", "Matériaux", "Divers", 64, 50, 0)
};

BridgeSpeckle.Send(@base, "084fa197d1", "a521c60881ae6dbb88ec2e7cce3a1a8985718b5a09", commitMessage: "Mur avec ouverture");

I would also like to be able to indicate an opening on the wall.

I try this way but it does not work.

var polyline = new Polyline(new List<double>() { 3, 0, 1, 3, 0, 3, 5, 0, 3, 5, 0, 1 });
polyline.closed = true;

var opening = new RevitWallOpening(polyline, wall);
wall.elements = new List<Base>() { opening };

Thanks in advance

This is expected behaviour (but agree not immediately apparent)

The Speckle viewer does not understand a Revit Wall, so the core instructions for generating BIM objects are backed up in our connectors with a fallback Mesh or meshes in a displayValue property.

When we create Speckle data from within Revit, we can access the DNA of the BIM object—for walls, this could be a baseline and a profile—but we also access the display geometry and convert that.

Revit understands these DNA instructions and generates a Revit Wall from those lines into native walls,
but the 3D viewer operates just as Sketchup or Blender, which also have no knowledge of Revit Walls or Walls in general, and they use the display object as their source geometry.

This approach implies that if you are programmatically generating BIM objects with the SDK, you also need to generate the displayValue programmatically. For simple geometry, this may not be a problem, but it can get quite hairy for anything more complex.

I understand then that it is the same if I want to indicate an opening in a wall ? I will have to generate the value of displayValue to.

Thanks you very much @jonathon

Yes. You will have to perform programmatically creating the hosting relationships and geometric interactions.

What are you looking to build that means creating Revit content external to revit but needing a web view? I’d love to know a little more context. Can you share?

Hi Jonathon,

Were are making a POC to test the interoperability between Speckle (web and connectors) + Treegram our software solution.

Thanks to your answer we have been able to send walls with openings, but only the gross geometry.

However, when we retrieve what was sent from Revit, you get the solid walls without openings.

We have then tried to define the openings with the wall, defining its hosting but the result is still a solid wall. I think we are missing the geometric interactions definition. Here is a snippet of the code.

var wall = new RevitWall()
{
    family = "Mur de base",
    type = "Générique - Ext. 200 mm",
    baseLine = new Line(new Point(0, 0), new Point(10, 0)),
    units = "m",
    level = new RevitLevel
    {
        name = "RDC",
        elevation = 0,
        units = "m"
    },
    height = 5,
    displayValue = new List<Mesh>() {
        // our mesh definition
    }
};

var polyline = new Polyline(new List<double>() { 3, 0, 1, 3, 0, 3, 5, 0, 3, 5, 0, 1 });
polyline.closed = true;

var opening = new RevitWallOpening(polyline, wall);
wall.elements = new List<Base>() { opening };
1 Like

Hi @jsantana ,

Is there any error related to the opening conversion showing up in the connector?
I would suggest debugging a local copy of the Revit connector to see what happens during the wall or wall opening conversion

2 Likes