{"id":240,"date":"2017-06-09T10:37:36","date_gmt":"2017-06-09T10:37:36","guid":{"rendered":"http:\/\/cadsupport.ru\/en\/?p=240"},"modified":"2018-08-10T08:52:55","modified_gmt":"2018-08-10T08:52:55","slug":"locked-objects-tekla","status":"publish","type":"post","link":"http:\/\/cadsupport.ru\/en\/locked-objects-tekla\/","title":{"rendered":"Locked Objects Tekla"},"content":{"rendered":"<p><img loading=\"lazy\" decoding=\"async\" class=\"alignleft size-medium wp-image-267\" src=\"http:\/\/cadsupport.ru\/en\/wp-content\/uploads\/2017\/06\/Tekla_Structures_ThereAreLockedObjects-300x117.png\" alt=\"Tekla Structures There are locked objects, see report. The operation could not be performed\" width=\"300\" height=\"117\" srcset=\"http:\/\/cadsupport.ru\/en\/wp-content\/uploads\/2017\/06\/Tekla_Structures_ThereAreLockedObjects-300x117.png 300w, http:\/\/cadsupport.ru\/en\/wp-content\/uploads\/2017\/06\/Tekla_Structures_ThereAreLockedObjects.png 322w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/>From time to time you can get annoying messages says that some objects are locked. Of course, we got official documentation which explains this issue wide enough. And this article is either based on it. But actually, there is a bunch of cases which are not covered by documentation or mentioned not clear enough (from my point of view of course). So let\u2019s go through object locking in Tekla Structures. And obtain some tools to deal with it easily.<\/p>\n<h2>\u00a0Locking objects<\/h2>\n<p>Locking is used to freeze parts of the model from unexpected changes. Such changes appear from time to time because of moving things which shouldn\u2019t be moved or during mass changing properties and UDA. When you select a couple of hundreds of parts, there is a big chance to select something which you not wonder. Such accidentally changes affecting numbering, ruing drawings and reports. That\u2019s why to freeze objects from change is a pretty cool idea. You could freeze your parts, and be sure that no one else modifies it without noticing.<\/p>\n<p>Instead of other CAD application Tekla do not have layer system to froze (Phases doesn\u2019t count). But prevention of changes is applicable for most of the model elements. All that you have to do is set UDA \u201cOBJECT_LOCKED\u201d to true.<\/p>\n<p>Here is a list of things which may be locked:<\/p>\n<ul>\n<li>project properties<\/li>\n<li><span style=\"font-style: inherit;\">phase properties<\/span><\/li>\n<li><span style=\"font-style: inherit;\">assemblies<\/span><\/li>\n<li><span style=\"font-style: inherit;\">parts (separately for beams, columns etc.)<\/span><\/li>\n<li><span style=\"font-style: inherit;\">bolts<\/span><\/li>\n<li><span style=\"font-style: inherit;\">welds<\/span><\/li>\n<li><span style=\"font-style: inherit;\">specific drawing types<\/span><\/li>\n<\/ul>\n<p><!--more--><\/p>\n<h2>UDA &#8220;OBJECT_LOCKED&#8221;<\/h2>\n<p>&#8220;OBJECT_LOCKED&#8221; actually is a boolean value which could be set to true (1) or false(0). But by default, you do not have such option in your list. You have to add this property in <strong>object.inp:<\/strong><\/p>\n<pre>attribute(\u201cOBJECT_LOCKED\u201d, \u201cLocked:\u201d, option, \u201c%s\u201d, none, none, \u201c0.0\u201d, \u201c0.0\u201d)<\/pre>\n<p style=\"padding-left: 0px;\">{<\/p>\n<p style=\"padding-left: 30px;\">value (\u201cNo\u201d,0)<\/p>\n<p style=\"padding-left: 30px;\">value (\u201cYes\u201d, 1)<\/p>\n<p style=\"padding-left: 0px;\">}<\/p>\n<p>And assign this attribute to all or some element from the list above.<\/p>\n<p style=\"font-style: inherit;\">After that, you will get a new property in UDA section of an object. Where &#8220;Yes&#8221; means Lock. And there is no way to modify entity until you reset Lock. Instead of change, you&#8217;ll get message\u00a0&#8220;There are locked objects, see report. The operation could not be performed.&#8221; and a report on access rights. But sometimes you may get the same message when you do not expect any traps.<\/p>\n<p style=\"font-style: inherit;\">You try to modify element, it&#8217;s definitely not locked, but you still get this message instead of expected result?<\/p>\n<p style=\"font-style: inherit;\">Let&#8217;s see what may happen &#8211; if any related element is set as locked, it will affect at whole assembly which contains such element. Take a look at scheme bellow<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-268 size-medium\" src=\"http:\/\/cadsupport.ru\/en\/wp-content\/uploads\/2017\/06\/Tekla_Structures_ThereAreLockedObjects_LockedHierarchy-300x209.png\" alt=\"Tekla Structures: There are locked objects scheme\" width=\"300\" height=\"209\" srcset=\"http:\/\/cadsupport.ru\/en\/wp-content\/uploads\/2017\/06\/Tekla_Structures_ThereAreLockedObjects_LockedHierarchy-300x209.png 300w, http:\/\/cadsupport.ru\/en\/wp-content\/uploads\/2017\/06\/Tekla_Structures_ThereAreLockedObjects_LockedHierarchy.png 393w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/p>\n<p>Above we mentioned that not only part could be locked. And if some of this tiny things is locked &#8211; it will cause this pretty annoying message each time when you try to modify elements even if it&#8217;s not locked.<\/p>\n<p>And we have \u00a0a few options to avoid this thing &#8211; add OBJECT_LOCKED property to each type of model objects, and then find those which is locked. Or remove lock with API function.<\/p>\n<p><!-- code formatted by http:\/\/manoli.net\/csharpformat\/ --><\/p>\n<pre class=\"csharpcode\"><span class=\"kwrd\">static<\/span> <span class=\"kwrd\">void<\/span> CAD_TeklaModelObject_Lock()\r\n        {\r\n            Tekla.Structures.Model.UI.ModelObjectSelector selected = <span class=\"kwrd\">new<\/span> Tekla.Structures.Model.UI.ModelObjectSelector();\r\n            Tekla.Structures.Model.ModelObjectEnumerator manyO = (selected.GetSelectedObjects() <span class=\"kwrd\">as<\/span> TSM.ModelObjectEnumerator);\r\n            while (manyO.MoveNext())\r\n            {\r\n                <span class=\"kwrd\">if<\/span> ((manyO.Current <span class=\"kwrd\">as<\/span> TSM.ModelObject) != <span class=\"kwrd\">null<\/span>)\r\n                {\r\n                    TSM.ModelObject pp = manyO.Current <span class=\"kwrd\">as<\/span> TSM.ModelObject;\r\n                    pp.SetUserProperty(<span class=\"str\">\"OBJECT_LOCKED\"<\/span>, 1);\r\n                    pp.Modify();\r\n                }\r\n            }\r\n            <span class=\"kwrd\">var<\/span> model = <span class=\"kwrd\">new<\/span> TSM.Model();\r\n            model.CommitChanges();\r\n        }<\/pre>\n<p>&nbsp;<\/p>\n<h2>Tekla Macro to Lock and Unlock all Model Objects<\/h2>\n<p>Below provided listing of Tekla Macro Script which could be run from tekla to unlock all selected elements in model. This script could be used to unlock assemblies, but you have to select these as assemblies.<\/p>\n<p><!-- code formatted by http:\/\/manoli.net\/csharpformat\/ --><\/p>\n<pre class=\"csharpcode\"><span class=\"kwrd\">namespace<\/span> Tekla.Technology.Akit.UserScript\r\n{\r\n    <span class=\"kwrd\">using<\/span> TSM = Tekla.Structures.Model;\r\n    <span class=\"kwrd\">using<\/span> System; \r\n    <span class=\"kwrd\">using<\/span> System.Windows.Forms;\r\n    \r\n    <span class=\"kwrd\">public<\/span> <span class=\"kwrd\">class<\/span> Script\r\n    {\r\n        <span class=\"kwrd\">public<\/span> <span class=\"kwrd\">static<\/span> <span class=\"kwrd\">void<\/span> Run(Tekla.Technology.Akit.IScript akit)\r\n        {\r\n        MessageBox.Show(CAD_TeklaModelObject_unLock().ToString());\r\n        }\r\n\r\n\r\n      <span class=\"kwrd\">static<\/span> <span class=\"kwrd\">int<\/span> CAD_TeklaModelObject_unLock()\r\n        {\r\n            Tekla.Structures.Model.UI.ModelObjectSelector selected = <span class=\"kwrd\">new<\/span> Tekla.Structures.Model.UI.ModelObjectSelector();\r\n            Tekla.Structures.Model.ModelObjectEnumerator manyO = (selected.GetSelectedObjects() <span class=\"kwrd\">as<\/span> TSM.ModelObjectEnumerator);\r\n        <span class=\"kwrd\">int<\/span> i=0; \r\n            while (manyO.MoveNext())\r\n            {\r\n                <span class=\"kwrd\">if<\/span> ((manyO.Current <span class=\"kwrd\">as<\/span> TSM.ModelObject) != <span class=\"kwrd\">null<\/span>)\r\n                {\r\n                    TSM.ModelObject pp = manyO.Current <span class=\"kwrd\">as<\/span> TSM.ModelObject;\r\n                    pp.SetUserProperty(<span class=\"str\">\"OBJECT_LOCKED\"<\/span>, 0);\r\n                    pp.Modify();\r\n            i++;\r\n                }\r\n            }\r\n            <span class=\"kwrd\">var<\/span> model = <span class=\"kwrd\">new<\/span> TSM.Model();\r\n            model.CommitChanges();\r\n        <span class=\"kwrd\">return<\/span> i; \r\n        }\r\n    }\r\n}<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>From time to time you can get annoying messages says that some objects are locked. Of course, we got official documentation which explains this issue wide enough. And this article is either based on it. But actually, there is a bunch of cases which are not covered by documentation or mentioned not clear enough (from [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[33,8,31,32,14,25],"class_list":["post-240","post","type-post","status-publish","format-standard","hentry","category-tekla","tag-advanced","tag-c","tag-faq","tag-setup","tag-tekla-structures","tag-teklaapi"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v23.1 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Locked Objects Tekla - CadSupport<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"http:\/\/cadsupport.ru\/en\/locked-objects-tekla\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Locked Objects Tekla - CadSupport\" \/>\n<meta property=\"og:description\" content=\"From time to time you can get annoying messages says that some objects are locked. Of course, we got official documentation which explains this issue wide enough. And this article is either based on it. But actually, there is a bunch of cases which are not covered by documentation or mentioned not clear enough (from [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"http:\/\/cadsupport.ru\/en\/locked-objects-tekla\/\" \/>\n<meta property=\"og:site_name\" content=\"CadSupport\" \/>\n<meta property=\"article:published_time\" content=\"2017-06-09T10:37:36+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2018-08-10T08:52:55+00:00\" \/>\n<meta property=\"og:image\" content=\"http:\/\/cadsupport.ru\/en\/wp-content\/uploads\/2017\/06\/Tekla_Structures_ThereAreLockedObjects-300x117.png\" \/>\n<meta name=\"author\" content=\"DonJad\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"DonJad\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"http:\/\/cadsupport.ru\/en\/locked-objects-tekla\/\",\"url\":\"http:\/\/cadsupport.ru\/en\/locked-objects-tekla\/\",\"name\":\"Locked Objects Tekla - CadSupport\",\"isPartOf\":{\"@id\":\"http:\/\/cadsupport.ru\/en\/#website\"},\"primaryImageOfPage\":{\"@id\":\"http:\/\/cadsupport.ru\/en\/locked-objects-tekla\/#primaryimage\"},\"image\":{\"@id\":\"http:\/\/cadsupport.ru\/en\/locked-objects-tekla\/#primaryimage\"},\"thumbnailUrl\":\"http:\/\/cadsupport.ru\/en\/wp-content\/uploads\/2017\/06\/Tekla_Structures_ThereAreLockedObjects-300x117.png\",\"datePublished\":\"2017-06-09T10:37:36+00:00\",\"dateModified\":\"2018-08-10T08:52:55+00:00\",\"author\":{\"@id\":\"http:\/\/cadsupport.ru\/en\/#\/schema\/person\/b57bc479c7822ae8efbc5a5b624a3b8a\"},\"breadcrumb\":{\"@id\":\"http:\/\/cadsupport.ru\/en\/locked-objects-tekla\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"http:\/\/cadsupport.ru\/en\/locked-objects-tekla\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"http:\/\/cadsupport.ru\/en\/locked-objects-tekla\/#primaryimage\",\"url\":\"http:\/\/cadsupport.ru\/en\/wp-content\/uploads\/2017\/06\/Tekla_Structures_ThereAreLockedObjects.png\",\"contentUrl\":\"http:\/\/cadsupport.ru\/en\/wp-content\/uploads\/2017\/06\/Tekla_Structures_ThereAreLockedObjects.png\",\"width\":322,\"height\":126,\"caption\":\"Tekla Structures There are locked objects, see report. The operation could not be performed\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"http:\/\/cadsupport.ru\/en\/locked-objects-tekla\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"http:\/\/cadsupport.ru\/en\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Locked Objects Tekla\"}]},{\"@type\":\"WebSite\",\"@id\":\"http:\/\/cadsupport.ru\/en\/#website\",\"url\":\"http:\/\/cadsupport.ru\/en\/\",\"name\":\"CadSupport\",\"description\":\"smart solutions for engineering duties\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"http:\/\/cadsupport.ru\/en\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"http:\/\/cadsupport.ru\/en\/#\/schema\/person\/b57bc479c7822ae8efbc5a5b624a3b8a\",\"name\":\"DonJad\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"http:\/\/cadsupport.ru\/en\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/b22cdec01f0612764c8b311b89954151bfb042524440d622849757864e132a55?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/b22cdec01f0612764c8b311b89954151bfb042524440d622849757864e132a55?s=96&d=mm&r=g\",\"caption\":\"DonJad\"},\"url\":\"http:\/\/cadsupport.ru\/en\/author\/donjad\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Locked Objects Tekla - CadSupport","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"http:\/\/cadsupport.ru\/en\/locked-objects-tekla\/","og_locale":"en_US","og_type":"article","og_title":"Locked Objects Tekla - CadSupport","og_description":"From time to time you can get annoying messages says that some objects are locked. Of course, we got official documentation which explains this issue wide enough. And this article is either based on it. But actually, there is a bunch of cases which are not covered by documentation or mentioned not clear enough (from [&hellip;]","og_url":"http:\/\/cadsupport.ru\/en\/locked-objects-tekla\/","og_site_name":"CadSupport","article_published_time":"2017-06-09T10:37:36+00:00","article_modified_time":"2018-08-10T08:52:55+00:00","og_image":[{"url":"http:\/\/cadsupport.ru\/en\/wp-content\/uploads\/2017\/06\/Tekla_Structures_ThereAreLockedObjects-300x117.png"}],"author":"DonJad","twitter_card":"summary_large_image","twitter_misc":{"Written by":"DonJad","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"http:\/\/cadsupport.ru\/en\/locked-objects-tekla\/","url":"http:\/\/cadsupport.ru\/en\/locked-objects-tekla\/","name":"Locked Objects Tekla - CadSupport","isPartOf":{"@id":"http:\/\/cadsupport.ru\/en\/#website"},"primaryImageOfPage":{"@id":"http:\/\/cadsupport.ru\/en\/locked-objects-tekla\/#primaryimage"},"image":{"@id":"http:\/\/cadsupport.ru\/en\/locked-objects-tekla\/#primaryimage"},"thumbnailUrl":"http:\/\/cadsupport.ru\/en\/wp-content\/uploads\/2017\/06\/Tekla_Structures_ThereAreLockedObjects-300x117.png","datePublished":"2017-06-09T10:37:36+00:00","dateModified":"2018-08-10T08:52:55+00:00","author":{"@id":"http:\/\/cadsupport.ru\/en\/#\/schema\/person\/b57bc479c7822ae8efbc5a5b624a3b8a"},"breadcrumb":{"@id":"http:\/\/cadsupport.ru\/en\/locked-objects-tekla\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["http:\/\/cadsupport.ru\/en\/locked-objects-tekla\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"http:\/\/cadsupport.ru\/en\/locked-objects-tekla\/#primaryimage","url":"http:\/\/cadsupport.ru\/en\/wp-content\/uploads\/2017\/06\/Tekla_Structures_ThereAreLockedObjects.png","contentUrl":"http:\/\/cadsupport.ru\/en\/wp-content\/uploads\/2017\/06\/Tekla_Structures_ThereAreLockedObjects.png","width":322,"height":126,"caption":"Tekla Structures There are locked objects, see report. The operation could not be performed"},{"@type":"BreadcrumbList","@id":"http:\/\/cadsupport.ru\/en\/locked-objects-tekla\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"http:\/\/cadsupport.ru\/en\/"},{"@type":"ListItem","position":2,"name":"Locked Objects Tekla"}]},{"@type":"WebSite","@id":"http:\/\/cadsupport.ru\/en\/#website","url":"http:\/\/cadsupport.ru\/en\/","name":"CadSupport","description":"smart solutions for engineering duties","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"http:\/\/cadsupport.ru\/en\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Person","@id":"http:\/\/cadsupport.ru\/en\/#\/schema\/person\/b57bc479c7822ae8efbc5a5b624a3b8a","name":"DonJad","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"http:\/\/cadsupport.ru\/en\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/b22cdec01f0612764c8b311b89954151bfb042524440d622849757864e132a55?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/b22cdec01f0612764c8b311b89954151bfb042524440d622849757864e132a55?s=96&d=mm&r=g","caption":"DonJad"},"url":"http:\/\/cadsupport.ru\/en\/author\/donjad\/"}]}},"_links":{"self":[{"href":"http:\/\/cadsupport.ru\/en\/wp-json\/wp\/v2\/posts\/240","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/cadsupport.ru\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/cadsupport.ru\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/cadsupport.ru\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/cadsupport.ru\/en\/wp-json\/wp\/v2\/comments?post=240"}],"version-history":[{"count":16,"href":"http:\/\/cadsupport.ru\/en\/wp-json\/wp\/v2\/posts\/240\/revisions"}],"predecessor-version":[{"id":324,"href":"http:\/\/cadsupport.ru\/en\/wp-json\/wp\/v2\/posts\/240\/revisions\/324"}],"wp:attachment":[{"href":"http:\/\/cadsupport.ru\/en\/wp-json\/wp\/v2\/media?parent=240"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/cadsupport.ru\/en\/wp-json\/wp\/v2\/categories?post=240"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/cadsupport.ru\/en\/wp-json\/wp\/v2\/tags?post=240"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}