How to create the GetPipeByPartsize node in dynamo similar like node of GetPipeByName, i have also attached script from python but i am getting syntax error if anyone could help me to solve this issue

What error are you getting? It is difficult to help if we don’t know what is happening
Please review the following FAQ How to get help on the Dynamo forums

You can also consult the Civil3D API documentation [here] as there is no method CivilDocument.GetPipeNetworks()

Alternately use the OOTB nodes