{"action":"reopened","issue":{"url":"https://api.github.com/repos/xBimTeam/XbimGeometry/issues/99","repository_url":"https://api.github.com/repos/xBimTeam/XbimGeometry","labels_url":"https://api.github.com/repos/xBimTeam/XbimGeometry/issues/99/labels{/name}","comments_url":"https://api.github.com/repos/xBimTeam/XbimGeometry/issues/99/comments","events_url":"https://api.github.com/repos/xBimTeam/XbimGeometry/issues/99/events","html_url":"https://github.com/xBimTeam/XbimGeometry/issues/99","id":300908595,"number":99,"title":"According to a single model instance, how to get its Guid?","user":{"login":"LoganQiong","id":34224151,"avatar_url":"https://avatars0.githubusercontent.com/u/34224151?v=4","gravatar_id":"","url":"https://api.github.com/users/LoganQiong","html_url":"https://github.com/LoganQiong","followers_url":"https://api.github.com/users/LoganQiong/followers","following_url":"https://api.github.com/users/LoganQiong/following{/other_user}","gists_url":"https://api.github.com/users/LoganQiong/gists{/gist_id}","starred_url":"https://api.github.com/users/LoganQiong/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LoganQiong/subscriptions","organizations_url":"https://api.github.com/users/LoganQiong/orgs","repos_url":"https://api.github.com/users/LoganQiong/repos","events_url":"https://api.github.com/users/LoganQiong/events{/privacy}","received_events_url":"https://api.github.com/users/LoganQiong/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2018-02-28T06:36:11Z","updated_at":"2018-03-06T07:42:32Z","closed_at":null,"author_association":"NONE","body":"I want to get Guid from each instance, and then spliced to the last json string, because another place need to use Guid, hope to help me! code show as below:\r\n\r\n            using (var model = IfcStore.Open(_ifcFile))\r\n            {\r\n                string jsonString = \"\";\r\n                var context = new Xbim3DModelContext(model);\r\n                context.CreateContext();\r\n\r\n                var instances = context.ShapeInstances();\r\n                foreach (var instance in instances)\r\n                {\r\n                    var geometry = context.ShapeGeometry(instance);\r\n                    var data = ((IXbimShapeGeometryData)geometry).ShapeData;\r\n\r\n\r\n                    //==========================================================\r\n\r\n                    //According to a single model instance, how to get its Guid?\r\n\r\n                    //==========================================================\r\n\r\n\r\n                    using (var stream = new MemoryStream(data))\r\n                    {\r\n                        using (var reader = new BinaryReader(stream))\r\n                        {\r\n                            var mesh = reader.ReadShapeTriangulation();\r\n\r\n                            //get the face\r\n                            List<XbimFaceTriangulation> Faces = mesh.Faces as List<XbimFaceTriangulation>;\r\n                            var faces_json = JsonConvert.SerializeObject(Faces);\r\n\r\n                            //Get the point\r\n                            List<XbimPoint3D> Point = mesh.Vertices as List<XbimPoint3D>;\r\n                            var point_json = JsonConvert.SerializeObject(Point);\r\n\r\n                            jsonString += \",{\\\"ObjectID\\\":\\\"Guid\\\",\\\"Faces\\\":[\" + faces_json.Substring(1) + \"],\\\"Points\\\":\" + point_json + \"}\";\r\n                        }\r\n                    }\r\n                }\r\n            }"}}
{"actor":{"display_login":"LoganQiong"}}