ComponentInstance Guid question
-
@tt_su said:
The GUID is Base64. Are you actually seeing dollar and underscore characters?
Apparently so in SU2014. Here is an example from a model of mine.
@unknownuser said:
3b1aPlRYjAAwO_o5_Y_sH8
1ek_9uHFbBkBOk60A4CUTj
2E9I543eD0KhmvF07odLJe
1FxdB0eHL9$O3G2kzcXhyB
2vY$wnUdb3PAiz$HWZGRRK
372Br$S2v6DeJBakA$Nfg3
2cAoJTfx1FPv1WkW5OmBeX
0N5ukFAF96AAR_zp1QMCjB
20fVk5NOj3DREBJ$kXpy$f -
Yes, these are the kind of Guids I get, but I'm using SketchUp 2015. I've only bothered trying with ComponentInstances though. Any particular reason why they seem non-standard Guids ? And are the dollars and underscores the only non alphanumeric symbols ?
-
It appear that Base64 character set will depend on implementation. I'm not exactly sure which ones we generate, but I'm asking for more details.
@oajfh said:
Any particular reason why they seem non-standard Guids ?
Which standard are you referring to?
-
I expect he means something like this:
1bbf21fa-6616-49a3-aa12-713a5e20370d
A GUID generator will make them...
https://www.guidgenerator.com/online-guid-generator.aspx
http://www.guidgen.com/
https://msdn.microsoft.com/en-us/library/kw069h38.aspx
They are all but sure to be unique... -
GUIDs doesn't have a standard for formatting though.
Looking into the GUIDs we return it they are based on the IFC specification which describe compressed GUIDs for file-based exchange: http://www.buildingsmart-tech.org/implementation/get-started/ifc-guid
Having said that - the API doesn't actually have a contract to which characters it return. It would be safest to not depend on specific delimiter characters and instead use something like JSON or XML to carry the data.
-
Thanks a lot for the details !
I believe that's my original question answered.
What exactly do you mean by "the API doesn't actually have a contract to which characters it return" though ? It isn't guaranteed to generate GUIDs containing only those characters from your base ?
-
The API currently call the underlying existing GUID implementation - just pass through the call. I wouldn't expect it to change, should the underlying GUID implementation change for whatever reason, then the characters might be different. Say if the IFC specs changed for instance.
-
Hello there !
I take benefit of this post to say that I have an example of one file with 2 components instances from 2 different definitions but with the same GUID.
So of course GUID is not unique.
My question : is the EntityID unique, but really unique within the same model ?
I mean, it may be a random number but the random number is checked to be sure that it's really unique.
Best regards.
Inteloide -
They are supposed to be unique. If you can, can you send Thomas (tt_su) the file by PM so he can take a look ?
-
EntityID are unique for the model - but entities will be assigned a new ID each time you open it. They are not persistent. There will not be two entities with the same entityID in a model.
ComponentDefinition GUIDs change as you modify the definition.
ComponentInstance GUIDs persist - even if you edit the instance/definition.
Advertisement