Catia to Speckle to Revit - How to define parameters?

Hi everyone,

I’m trying to push some geometry with parameters from Catia V6 to Speckle and then from Speckle to Revit. I am able to successfully push the geometry as a mesh however I have a bit more trouble to do so with parameters that don’t come through. I was hopping to get some help on understanding how I need to define my parameters so Speckle recognize them and able to push it through to Revit. Added a screenshot of a sample where I try to fill the Comments parameter without luke.

One important thing that I should mention is that there are no Catia to Speckle connectors so I am using webservice to post graphql queries in the body of the webcall.

Thanks,
Anatoly

2 Likes

Hi @anatolyj! If revit parameters would be easily stored as simple key value pairs, that would’ve been amazing. Unfortunately, because of many horrible reasons (I’m sure all specklers would love to rant here), they’re a bit more complex than that:


(from here)

I struggled to find something that already has a comment parameter, but you could send something from revit that does have a comment, see how we actually manage that, and then try to reproduce the structure in what you send from Catia.

@teocomi might be able to help more here than me though…

4 Likes

Hey @anatolyj !

Welcome to the forum, great to see progress Catia :point_right: Revit via Speckle!

Assuming you are creating/editing objects in the Revit connector (and not just trying to update parameters), the parameters should be structured something like:

{
  "speckle_type ": "Objects.BuiltElements.Floor:Objects.BuiltElements.Revit.RevitFloor",
  "parameters": {
    "speckle_type": "Base",
    "PARAM_NAME": {
      "value": "Hello!",
      "speckle_type" : "Objects.BuiltElements.Revit.Parameter",
      "units": "none"
    }
  },
  ... more floor pros here
}

Where PARAM_NAME can either be:

  • the full Revit BuiltInParameter name eg ALL_MODEL_INSTANCE_COMMENTS
  • the param name displayed in Revit’s UI eg Comments
  • the Shared Parameter GUID if it’s a shared parameter

For units, you can refer to this explanation, in short:

  • if it’s a length based parameter (eg Base Offset) use a Speckle unit (mm, cm, m, km, in, ft, yd, mi, none )
  • if it’s a non-length based parameter (eg Air FLow) you should set the units to none. Speckle will then simply assume the value used matches the display units being used in Revit (eg L/s) and will not convert them.
  • Speckle currently does not support converting non-length base units

Here is where we are handling that logic, and where you might need to put a few breakpoints:

Hope it helps, let us know how it goes!

2 Likes

Thanks @dimitrie and @teocomi for the quick response :). Just wanted to give a quick update on the progress. I tried few strategies that you guys suggested to push parameters but had no luck. I am able to push my geometry with parameters to speckle without errors but then I get the following error when trying to receive the data in Revit:


I know that I’m not defining the “…DirectShape” correctly. I tried to go through the c# code but had no luck figuring out what I’m missing (sorry… I’m a newbie in C#) and need a bit of help understand how to define correctly this DirectShape or if maybe I should use a different Revit object. Hoping that once i clear that bug, I would see the parameters filled with values that I’m trying to push :stuck_out_tongue:

1 Like

Hi @anatolyj! Can you send us over one of those faulty direct shapes you are baking? Just send it to our production server and link the stream/share it with us.

This will allow @AlanRynne / @teocomi / one of us to debug the receiving end and pin point what’s wrong upstream (or maybe it’s a bug on our end).

2 Likes

@anatolyj it might actually be easier if we schedule a quick dojo session where we show you how to debug the Revit connector, that would help you even more speed up your development process!

2 Likes

@dimitrie here is a simple sample stream I created: https://speckle.d-meveportal.goriv.co/streams/6860ad5190

@teocomi that would be great! Anytime next week works for me :slight_smile:

Sweet! I’ve sent an invite to your forum email for Tuesday at 4pm UK.
For anyone else reading this and wanting to join, here’s the google meet:

You’ll need to have:

  • Revit 2019-2022 installed
  • Visual Studio (or another IDE)
  • a copy of spekcle-sharp cloned on your machine
  • Manger installed and an account set up
  • that should be it :crossed_fingers:

Speak soon!

2 Likes

thanks @teocomi, I will be there :smiley:

Just to put a closure on this thread just in case someone is interested, I was able to push geometry along with parameters to Revit. The major change that I did that made it work is using “baseGeometries” list instead of “displayMesh”. Here is my sample GraphQL code:

mutation{
  objectCreate(    
    objectInput:
    {
      streamId: "xxxxxxxxxxxxxxx"
      objects: 
      [{
            id: "00035" 
        	speckle_type:"Base"
        	Generic_Models:
            [{
                id:"Id123"
            	type:"Type123"
            	name:"Name123"
            	elementId:"ElementId123"
            	units:"ft" 
            	applicationId:"appID123"
            	speckle_type:"Objects.BuiltElements.Revit.DirectShape"
            	category:12 
            	parameters:{
                    id:"baseParamsID"
                    speckle_type:"Base"
                    ALL_MODEL_MARK:{
                        id:"markParamId"
                        name:"Mark"
                        value:"Test Mark 123"
                        units:"none"
                        speckle_type:"Objects.BuiltElements.Revit.Parameter"
                    }
                    ALL_MODEL_INSTANCE_COMMENTS:{
                        id:"CommentParamId"
                        name:"Comments"
                        value:"Test Comment 123"
                        units:"none"
                        speckle_type:"Objects.BuiltElements.Revit.Parameter"
                    }
                }
            	baseGeometries:[{
                    id:"FR" 
              	    speckle_type:"Objects.Geometry.Mesh" 
              	    units:"ft" 
                    name:"MeshTestName"
              	    vertices:[0,0,0,0,7,0,5,5,0,5,0,0] 
              	    faces:[1,0,1,2,3]
                }]
            }]
        }]
      }
   )
}

5 Likes