Hi,
I’m looking for a way to generate a unique serial number (like a GUID) to tag parent/child linkage.
Does anybody know a way to generate these?
-Willem
Hi,
I’m looking for a way to generate a unique serial number (like a GUID) to tag parent/child linkage.
Does anybody know a way to generate these?
-Willem
Check this:
https://docs.python.org/2/library/uuid.html
Example:
import uuid
#make a UUID based on the host ID and current time
Print uuid.uuid1()
Thanks Jordy.
I was looking for a way without importing another module and maybe have it available though Common but for now this will do.
-Willem
You could also use this .NET function (which is probably what the Rhino/GH peeps do I imagine):
import System
g = System.Guid.NewGuid()
print g
Anders had the right idea. To convert to string, do this:
import System
g = System.Guid.NewGuid().ToString()
print g
Hi Dale,
how can we convert this string again to guid?
Thanks