# DirectShape warning: expects this, but was that

**URL:** https://forum.dynamobim.com/t/directshape-warning-expects-this-but-was-that/53916
**Category:** Geometry
**Created:** [August 10, 2020, 8:37pm UTC](https://forum.dynamobim.com/t/directshape-warning-expects-this-but-was-that/53916 "2020-08-10T20:37:58Z")
**Posts on this page:** 13
**Page:** 1

<div class="post-metadata">

### Author: ![rodrigo.bezerra](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/rodrigo.bezerra/32/99963_2.png) [@rodrigo.bezerra](https://forum.dynamobim.com/u/rodrigo.bezerra)
#### Post date: [August 10, 2020, 8:37pm UTC](https://forum.dynamobim.com/t/directshape-warning-expects-this-but-was-that/53916/1 "2020-08-10T20:37:58Z")

</div>

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](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/3/1/314bb88af2298028d7d8ac0efae5be18eb169e0d.png)

[importaObjCriaMeshExportaDirectShape.dyn](https://forum.dynamobim.com/uploads/short-url/agbAQo5LKAcB5mBCCYKU6ZwRfxu.dyn) (17.6 KB)

---

<div class="post-metadata">

### Author: ![Thomas\_Mahon](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/thomas_mahon/32/64209_2.png) [@Thomas\_Mahon](https://forum.dynamobim.com/u/Thomas_Mahon)
#### Post date: [August 10, 2020, 8:56pm UTC](https://forum.dynamobim.com/t/directshape-warning-expects-this-but-was-that/53916/2 "2020-08-10T20:56:20Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![rodrigo.bezerra](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/rodrigo.bezerra/32/99963_2.png) [@rodrigo.bezerra](https://forum.dynamobim.com/u/rodrigo.bezerra)
#### Post date: [August 10, 2020, 9:06pm UTC](https://forum.dynamobim.com/t/directshape-warning-expects-this-but-was-that/53916/3 "2020-08-10T21:06:42Z")

</div>

Do you mean like this:

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/5/b/5b189c2dc2773692f47b0f789da0ea6eddbb9a26.png)

---

<div class="post-metadata">

### Author: ![Thomas\_Mahon](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/thomas_mahon/32/64209_2.png) [@Thomas\_Mahon](https://forum.dynamobim.com/u/Thomas_Mahon)
#### Post date: [August 10, 2020, 9:09pm UTC](https://forum.dynamobim.com/t/directshape-warning-expects-this-but-was-that/53916/4 "2020-08-10T21:09:16Z")

</div>

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

![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/3/c/3ce050b609e5cba7a1fb0ecdcc21b813310b8ee1.png)

---

<div class="post-metadata">

### Author: ![rodrigo.bezerra](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/rodrigo.bezerra/32/99963_2.png) [@rodrigo.bezerra](https://forum.dynamobim.com/u/rodrigo.bezerra)
#### Post date: [August 10, 2020, 9:13pm UTC](https://forum.dynamobim.com/t/directshape-warning-expects-this-but-was-that/53916/5 "2020-08-10T21:13:46Z")

</div>

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

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](https://www.youtube.com/watch?v=v74AfnZG34o) ?

---

<div class="post-metadata">

### Author: ![Thomas\_Mahon](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/thomas_mahon/32/64209_2.png) [@Thomas\_Mahon](https://forum.dynamobim.com/u/Thomas_Mahon)
#### Post date: [August 10, 2020, 9:28pm UTC](https://forum.dynamobim.com/t/directshape-warning-expects-this-but-was-that/53916/6 "2020-08-10T21:28:10Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![rodrigo.bezerra](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/rodrigo.bezerra/32/99963_2.png) [@rodrigo.bezerra](https://forum.dynamobim.com/u/rodrigo.bezerra)
#### Post date: [August 10, 2020, 9:35pm UTC](https://forum.dynamobim.com/t/directshape-warning-expects-this-but-was-that/53916/7 "2020-08-10T21:35:43Z")

</div>

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

 ![importaObjCriaMeshExportaDirectShape2](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/0/3/0348e61639cf55953a98ee501dfff25fc4aee757.png)

But got this at the end:

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/2/0/20f4fda57cb4f9a31c344ec3ec406e1a0bae414b.png)

---

<div class="post-metadata">

### Author: ![rodrigo.bezerra](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/rodrigo.bezerra/32/99963_2.png) [@rodrigo.bezerra](https://forum.dynamobim.com/u/rodrigo.bezerra)
#### Post date: [August 10, 2020, 9:47pm UTC](https://forum.dynamobim.com/t/directshape-warning-expects-this-but-was-that/53916/8 "2020-08-10T21:47:13Z")

</div>

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

 ![importaObjCriaMeshExportaDirectShape3](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/c/5/c5e4335a9bc9aed774217180f3d462679297d00c.png)

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.

---

<div class="post-metadata">

### Author: ![Thomas\_Mahon](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/thomas_mahon/32/64209_2.png) [@Thomas\_Mahon](https://forum.dynamobim.com/u/Thomas_Mahon)
#### Post date: [August 10, 2020, 9:49pm UTC](https://forum.dynamobim.com/t/directshape-warning-expects-this-but-was-that/53916/9 "2020-08-10T21:49:28Z")

</div>

Exactly as I suggested re the mesh conversion 😉 (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).

---

<div class="post-metadata">

### Author: ![rodrigo.bezerra](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/rodrigo.bezerra/32/99963_2.png) [@rodrigo.bezerra](https://forum.dynamobim.com/u/rodrigo.bezerra)
#### Post date: [August 10, 2020, 9:52pm UTC](https://forum.dynamobim.com/t/directshape-warning-expects-this-but-was-that/53916/10 "2020-08-10T21:52:11Z")

</div>

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?

---

<div class="post-metadata">

### Author: ![Vikram\_Subbaiah](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/vikram_subbaiah/32/50797_2.png) [@Vikram\_Subbaiah](https://forum.dynamobim.com/u/Vikram_Subbaiah)
#### Post date: [August 11, 2020, 4:13am UTC](https://forum.dynamobim.com/t/directshape-warning-expects-this-but-was-that/53916/11 "2020-08-11T04:13:23Z")

</div>

> [@rodrigo.bezerra](#):
>
> So much detail to pay attention to

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_2020-08-11_09-32-15](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/e/6/e6afaed1a46229953bd45e0a421492f753f5a6a1.png)  
[directShape.dyn](https://forum.dynamobim.com/uploads/short-url/lxZKvY18xUvpkaJ6g4asIWw2UuB.dyn) (33.0 KB)

---

<div class="post-metadata">

### Author: ![y.elamri](https://avatars.discourse-cdn.com/v4/letter/y/f05b48/32.png) [@y.elamri](https://forum.dynamobim.com/u/y.elamri)
#### Post date: [January 5, 2021, 3:42pm UTC](https://forum.dynamobim.com/t/directshape-warning-expects-this-but-was-that/53916/12 "2021-01-05T15:42:20Z")

</div>

![Capture1](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/1/8/18ddfc68d8e85689410ec8ec2f2416bcc17c9bac.png)  
i have tried this script but i got some errors

---

<div class="post-metadata">

### Author: ![y.elamri](https://avatars.discourse-cdn.com/v4/letter/y/f05b48/32.png) [@y.elamri](https://forum.dynamobim.com/u/y.elamri)
#### Post date: [January 5, 2021, 3:49pm UTC](https://forum.dynamobim.com/t/directshape-warning-expects-this-but-was-that/53916/13 "2021-01-05T15:49:36Z")

</div>

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 !

 ![Capture3](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/4/6/469cd4609ba503ba746f7f64201cb42d4644bfea.png)
