{"action":"created","issue":{"url":"https://api.github.com/repos/xBimTeam/XbimEssentials/issues/42","repository_url":"https://api.github.com/repos/xBimTeam/XbimEssentials","labels_url":"https://api.github.com/repos/xBimTeam/XbimEssentials/issues/42/labels{/name}","comments_url":"https://api.github.com/repos/xBimTeam/XbimEssentials/issues/42/comments","events_url":"https://api.github.com/repos/xBimTeam/XbimEssentials/issues/42/events","html_url":"https://github.com/xBimTeam/XbimEssentials/issues/42","id":162505110,"number":42,"title":"How to write and save ifc files now? (seems that xBimDocument has been deleted.)","user":{"login":"WangYini","id":17810920,"avatar_url":"https://avatars.githubusercontent.com/u/17810920?v=3","gravatar_id":"","url":"https://api.github.com/users/WangYini","html_url":"https://github.com/WangYini","followers_url":"https://api.github.com/users/WangYini/followers","following_url":"https://api.github.com/users/WangYini/following{/other_user}","gists_url":"https://api.github.com/users/WangYini/gists{/gist_id}","starred_url":"https://api.github.com/users/WangYini/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/WangYini/subscriptions","organizations_url":"https://api.github.com/users/WangYini/orgs","repos_url":"https://api.github.com/users/WangYini/repos","events_url":"https://api.github.com/users/WangYini/events{/privacy}","received_events_url":"https://api.github.com/users/WangYini/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-06-27T17:28:54Z","updated_at":"2016-06-28T06:28:00Z","closed_at":null,"body":"In the given example in https://xbim.codeplex.com/  the ifc file can be written and saved through xBimDocument class. But I can't find this class in xBimToolkit now. Is this writing function still available in xbim toolkit? \r\nThank you very much!"},"comment":{"url":"https://api.github.com/repos/xBimTeam/XbimEssentials/issues/comments/228959913","html_url":"https://github.com/xBimTeam/XbimEssentials/issues/42#issuecomment-228959913","issue_url":"https://api.github.com/repos/xBimTeam/XbimEssentials/issues/42","id":228959913,"user":{"login":"martin1cerny","id":773078,"avatar_url":"https://avatars.githubusercontent.com/u/773078?v=3","gravatar_id":"","url":"https://api.github.com/users/martin1cerny","html_url":"https://github.com/martin1cerny","followers_url":"https://api.github.com/users/martin1cerny/followers","following_url":"https://api.github.com/users/martin1cerny/following{/other_user}","gists_url":"https://api.github.com/users/martin1cerny/gists{/gist_id}","starred_url":"https://api.github.com/users/martin1cerny/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/martin1cerny/subscriptions","organizations_url":"https://api.github.com/users/martin1cerny/orgs","repos_url":"https://api.github.com/users/martin1cerny/repos","events_url":"https://api.github.com/users/martin1cerny/events{/privacy}","received_events_url":"https://api.github.com/users/martin1cerny/received_events","type":"User","site_admin":false},"created_at":"2016-06-28T06:28:00Z","updated_at":"2016-06-28T06:28:00Z","body":"Hi @WangYini , thanks for your interest in xBIM. It is indeed possible to create and save IFC files with xBIM. The whole toolkit has gone quite a journey since we moved from Codeplex to GitHub. The best from xBIM is now in `develop` branch which is pretty stable by now. Preferred document level object is `IfcStore` which can handle both IFC2x3 and IFC4. The easiest way to use it is to add our development NuGet stream https://www.myget.org/F/xbim-develop/api/v2.\r\n\r\nBasic code would look like this:\r\n```cs\r\nvar credentials = new XbimEditorCredentials\r\n{\r\n    ApplicationDevelopersName = \"Martin\",\r\n    ApplicationFullName = \"xBIM Sample Application\",\r\n    ApplicationIdentifier = \"xBIM SA\",\r\n    ApplicationVersion = \"0.1\",\r\n    EditorsFamilyName = \"Cerny\",\r\n    EditorsGivenName = \"Martin\",\r\n    EditorsOrganisationName = \"xBIM Team\"\r\n};\r\nusing (var model = IfcStore.Create(credentials, IfcSchemaVersion.Ifc2X3, XbimStoreType.InMemoryModel))\r\n{\r\n    using (var txn = model.BeginTransaction(\"Data creation\"))\r\n    {\r\n        var wall = model.Instances.New<IfcWall>(w => w.Name = \"Brand new wall\");\r\n        var prop = model.Instances.New<IfcPropertySingleValue>(p =>\r\n        {\r\n            p.Name = \"InternalID\";\r\n            p.NominalValue = new IfcIdentifier(\"9A17A7FF-F4ED-458B-A69B-9C3F72D7EFB4\");\r\n        });\r\n        var pSet = model.Instances.New<IfcPropertySet>(ps =>\r\n        {\r\n            ps.Name = \"Internal Properties\";\r\n            ps.HasProperties.Add(prop);\r\n        });\r\n        model.Instances.New<IfcRelDefinesByProperties>(r =>\r\n        {\r\n            r.RelatingPropertyDefinition = pSet;\r\n            r.RelatedObjects.Add(wall);\r\n        });\r\n\r\n        txn.Commit();\r\n    }\r\n    model.SaveAs(\"model.ifc\");\r\n}\r\n\r\n```"}}
{"actor":{"display_login":"martin1cerny"}}