Revit DirectShape with Wall Category

Hi all,

I’m trying to instantiate a DirectShape object with a Revit.Wall category through this constructor.

Something like this…
var wall = new DirectShape("test",Revit.Wall, geom, params);

But got thrown an error saying a Directshape cannot be assigned with Wall category.

I thought this was a Revit issue, but i tried to create a DirectShape (with wall category) in Dynamo but there weren’t any issue.

Is there anyway around the error ?


Scratch this, I tried again and somehow it worked. Will revisit this if it happens again :sweat_smile:

var b = new DirectShape( "test", RevitCategory.Walls, geom, null );
b.units = "m";
b.applicationId = "hi";