sketchucation logo sketchucation
    • Login
    ℹ️ Licensed Extensions | FredoBatch, ElevationProfile, FredoSketch, LayOps, MatSim and Pic2Shape will require license from Sept 1st More Info

    ComponentInstance Guid question

    Scheduled Pinned Locked Moved Developers' Forum
    12 Posts 7 Posters 1.3k Views 7 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • O Offline
      oajfh
      last edited by

      Hi,

      Quick question : Which characters are NOT part of a ComponentInstance Guid ? It seems these specific guids are not the same as the longer guids one can find elsewhere, and the only thing the API says is 'a unique 22 character ID', or something along those lines.

      I'm sending ComponentInstance data from SketchUp, and the quick dirty way I'm sending it so far is by creating a string from data. I don't want the guid to mess up my delimiters, so I'd like to make sure it's ok.

      So far, the guids I've looked at were exclusively composed of alphabetical, numeric, '$' and '_' characters. I didn't see others, but...

      Does anyone know ? For the moment I'm going to assume there's no whitespace...

      1 Reply Last reply Reply Quote 0
      • tt_suT Offline
        tt_su
        last edited by

        The GUID is Base64. Are you actually seeing dollar and underscore characters? 😲

        1 Reply Last reply Reply Quote 0
        • sdmitchS Offline
          sdmitch
          last edited by

          @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

          Nothing is worthless, it can always be used as a bad example.

          http://sdmitch.blogspot.com/

          1 Reply Last reply Reply Quote 0
          • O Offline
            oajfh
            last edited by

            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 ?

            1 Reply Last reply Reply Quote 0
            • tt_suT Offline
              tt_su
              last edited by

              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?

              1 Reply Last reply Reply Quote 0
              • TIGT Offline
                TIG Moderator
                last edited by

                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...

                TIG

                1 Reply Last reply Reply Quote 0
                • tt_suT Offline
                  tt_su
                  last edited by

                  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.

                  1 Reply Last reply Reply Quote 0
                  • O Offline
                    oajfh
                    last edited by

                    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 ?

                    1 Reply Last reply Reply Quote 0
                    • tt_suT Offline
                      tt_su
                      last edited by

                      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.

                      1 Reply Last reply Reply Quote 0
                      • inteloideI Offline
                        inteloide
                        last edited by

                        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

                        Humanity will do a huge step when the IT professionals will understand that computers are tools...

                        1 Reply Last reply Reply Quote 0
                        • Dan RathbunD Offline
                          Dan Rathbun
                          last edited by

                          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 ?

                          I'm not here much anymore.

                          1 Reply Last reply Reply Quote 0
                          • thomthomT Offline
                            thomthom
                            last edited by

                            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.

                            Thomas Thomassen — SketchUp Monkey & Coding addict
                            List of my plugins and link to the CookieWare fund

                            1 Reply Last reply Reply Quote 0
                            • 1 / 1
                            • First post
                              Last post
                            Buy SketchPlus
                            Buy SUbD
                            Buy WrapR
                            Buy eBook
                            Buy Modelur
                            Buy Vertex Tools
                            Buy SketchCuisine
                            Buy FormFonts

                            Advertisement