@bermu wrote:
Hi all,
Could someone tell me how to make this python code shorter and more professionnal?
Thank you in advance…import rhinoscriptsyntax as rs
import ghpythonlib.components as ghcompif brep == None and weightSetted == 0 :
metalWeight = 0if weightSetted > 0 :
metalWeight = weightSettedif brep != None:
metalWeight = ghcomp.Volume(brep)
volume = ghcomp.ListItem (metalWeight,[0],True)
metalWeight = (volume * density)/1000metalWeight = weightSetted + metalWeight
print metalWeight
Posts: 3
Participants: 2