Create GUID from string for shared parameters definitions

i am trying to construct a GUID from a given bSdd-GUID.

the relevant code runs like:

opt = ExternalDefinitionCreationOptions(_paramName[k],_paramType[k])
opt.Visible = _visible[k]
#aktGuid = uuid.UUID(_guid[k]).hex
opt.GUID = uuid.UUID(_guid[k])
opt.UserModifiable =_editable[k]
opt.Description = _description[k]

the _guid[k] = something like “eeedd419-a265-4615-b8cb-a40f4428835e”

as you can see i already tried the various construction methods for uuid library like .hex …

whatever i try the result is either:

TypeError: expected Guid, got Object_1$1

when using uuid.UUID(_guid[k])

or

TypeError: expected Guid, got str

when I try uuid.UUID(_guid[k]).hex

any suggestions?

Hi Peter,

Try Bakery Package. It has got some nodes on GUIDS. Hope It helps!

 

1 Like

KULKUL unfortunately my bakery package seems to be incomplete (though i downloaded the latest verscion today)

UUID GUID Generator … does not exist as a node.

(both 15 & 16)

kulkul, thanks for your efforts! unfortunately i need to create a guid from string and don’t have any valid results

kulkul, i have to apologize!

i missed the System.Guid in your sample!

it is some sort of working now!

tx peter

No Problem <em style=“font-weight: 300;”>

Good t o know you found out that :)

yeah absolutely!

didn’t know that dynamo’s IronPython implementation does not support the uuid library. on the other hand it was cool to find out that .Net provides that functionality too!

best

Be careful about using the bsdd guids when converting to a hex format. Firstly the 64bit 22 length bsdd guids don’t use standard 64-bit encoding. The character sequence that bsdd uses is in ISO 12006-3. Secondly the algorithm that goes between the bsdd and the hex version has been somewhat inconsistently applied in the DataDictionary so some but not all will reach the official hex version of the guid written in ifc.
e.g
Pset_DoorCommon.FireRating
bsdd = 1xeBm0qTiHuO00025QrE$V http://bsdd.catenda.com/api/4.0/IfdConcept/search/filter/type/PROPERTY/Pset_DoorCommon.FireRating
ifcguid = 7ba0bc00d1db11e1800000215ad4efdf
http://www.buildingsmart-tech.org/ifc/IFC4x1/final/html/psd/Pset_DoorCommon.xml

is this possible to get all project GUIDs?