Usage of Editor.command() in script

I’m trying to create dynamo node to convert pressure pipes into 3DSoilds using C#.
I have written the function which is working fine when used as a CommandMethod. But is throwing error when used as dynamo node.

I’m selecting the pipe objects to convert and then using the below code to convert it to 3D soilds.
ed.Command("._CONVERTTO3DSOLIDS", “N”);
I observed that error is thrown at this line.
Is there any other way to convert the pipes to 3D solids?

The API has the Solid3dBody property which looks like it should do what you want. (Its part of the parent “Part” class rather than the “Pipe” class itself)

It returns a 3D solid, so you need to write the code to add that solid into the DWG file. You would also need to write some code to delete the original pipe object, if that’s what you need to do