DirectShape warning: expects this, but was that

So… I’m importing a obj mesh, so I can push it into a conceptual mass. But I don’t know why DirectShape.ByGeometry node do not work.

Warning: DirectShape.ByGeometry expects argument type(s) (Geometry, Category, Material, string), but was called with (Autodesk.DesignScript.Geometry.Mesh[], Revit.Elements.Category, Revit.Elements.Material, string).

importaObjCriaMeshExportaDirectShape.dyn (17.6 KB)

Mesh doesn’t inherit from Dynamo’s ProtoGeometry Geometry base class, so its an invalid input. You’ll need to find a way of converting it to one of the entity types you see OOTB under Dynamo’s Geometry node library.

2 Likes

Do you mean like this:

Doesn’t look like it unfortunately - Solid or Surface do inherit from the Geometry base class, so you could start there

image

I so appreciate your help, Thomas, but I have no clue where to find this, :sweat_smile:

I also tried to push the mesh to Revit with DirectShape.ByMesh and got an similar error about “expect other thing”

Am I not trying something similar like this: https://www.youtube.com/watch?v=v74AfnZG34o ?

Try DirectShape.ByMesh again but you’ll need to be able to convert the mesh from MeshToolkit to a Dynamo mesh (under its geometry node library). Failing that, give that Spring node in the video a shot and you should get a result.

1 Like

This sequence almost did the trick. No yellow balloon on top of the node…

But got this at the end:

Now worked. I used information to put another mesh together just to input into DirectShape.ByMesh node.

Other thing I noticed is I must set category to MASS, instead of MASS FORM. And instead of a mesh in a conceptual mass, I now have a mass inside a mass. Makes more sense to put directly into the the project model then.

Exactly as I suggested re the mesh conversion :wink: (a mesh entity from mesh toolkit is not the same as a mesh from Dynamos ProtoGeometry library which is why you saw that exception to begin with).

2 Likes

So much detail to pay attention to… It is not easy.

And what about the subcategory issue? Why can’t I specify the geometry to enter Revit as a MASS FORM or another subcategory I create?

Basically avoid connecting a mesh obtained from the Mesh Toolkit notes to the input of the OOTB Mesh nodes
Instead obtain Vertices (points) and Indices (integers) and recreate the mesh.

Confusing, but once you’re able to distinguish the nodes it should be a little less trouble.


directShape.dyn (33.0 KB)

5 Likes


i have tried this script but i got some errors

I have trued first this script i could have the mesh on Dynamo but into revit always have a problem with direct shape by mesh
thanks for helping !