Usage of Editor.command() in script

Hi,
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)

http://docs.autodesk.com/CIV3D/2019/ENU/API_Reference_Guide/html/c89ab82e-a5eb-e04d-6c95-d9432fbb3c10.htm

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