{"id":908,"date":"2014-10-08T20:40:41","date_gmt":"2014-10-08T20:40:41","guid":{"rendered":"http:\/\/elbsolutions.com\/projects\/?p=908"},"modified":"2022-02-03T11:25:00","modified_gmt":"2022-02-03T17:25:00","slug":"autocad-get-field-edit-value-block-attribute","status":"publish","type":"post","link":"https:\/\/elbsolutions.com\/projects\/autocad-get-field-edit-value-block-attribute\/","title":{"rendered":"Autocad- get to the field edit value of a block attribute"},"content":{"rendered":"<p>Well, this was like looking for a needle in a haystack. I tried to use google to know if a block attribute referred to text or to a formula that made the text. The key is looking at the extension dictionary. If there is one, it has dictionaries inside of them and if one of the items in named &#8220;ACAD_FIELD&#8221; then&#8230; yes this attribute is de-referenced or aliased or abstracted by using a formula. I was usinging the attributes .Text property which gives you the RESULT of the field formula underneath. I was doing search and replaces and blowing away the formulas &#8211; which would have been best left alone. Now I can skip them.<\/p>\n<p>The g<a href=\"http:\/\/www.vbaexpress.com\/forum\/showthread.php?37524-Solved-Read-field-in-AUTOCAD-block-attribute\" target=\"_blank\" rel=\"noopener noreferrer\">uy here about 8\u00a0posts down AFTER reading the code was my hero <\/a>on this one. It was after about 20 google searches.<\/p>\n<p><!--more--><\/p>\n<p>Here is the relevant code.<\/p>\n[vba]\n<pre class=\"bbcode_code\"><span style=\"font-family: verdana;\"><span class=\"keyword\">Dim<\/span> Xdictionary <span class=\"keyword\">As<\/span> AcadDictionary \r\n                <span class=\"keyword\">Set<\/span> Xdictionary = attObj.GetExtensionDictionary \r\n                <span class=\"keyword\">Dim<\/span> fldObject <span class=\"keyword\">As<\/span> <span class=\"keyword\">Object<\/span> \r\n                <span class=\"keyword\">On Error Resume Next<\/span> \r\n                 <span class=\"comment\">' check if attribute has field<\/span>\r\n                <span class=\"keyword\">Set<\/span> fldObject = Xdictionary.GetObject(\"ACAD_FIELD\") \r\n                <span class=\"keyword\">If<\/span> Err.Number &lt;&gt; 0 <span class=\"keyword\">Then<\/span> \r\n                    Err.Clear \r\n                    <span class=\"keyword\">If<\/span> fldObject <span class=\"keyword\">Is<\/span> <span class=\"keyword\">Nothing<\/span> <span class=\"keyword\">Then<\/span> \r\n                        Exit <span class=\"keyword\">Sub<\/span> \r\n                    <span class=\"keyword\">End<\/span> <span class=\"keyword\">If<\/span> \r\n                <span class=\"keyword\">End<\/span> <span class=\"keyword\">If<\/span> \r\n                 \r\n                 <span class=\"comment\">'get attribute Handle property <\/span>\r\n                attHandle = attObj.handle \r\n                <span class=\"keyword\">Debug.Print<\/span> attHandle <\/span><\/pre>\n[\/vba]\n<p>This item, if you then keep digging will eventually lead us to the formula underneath.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Well, this was like looking for a needle in a haystack. I tried to use google to know if a block attribute referred to text or to a formula that made the text. The key is looking at the extension dictionary. If there is one, it has dictionaries inside of them and if one of [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-908","post","type-post","status-publish","format-standard","hentry","category-general"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.7 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Autocad- get to the field edit value of a block attribute - ELB Solutions.com Inc.<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/elbsolutions.com\/projects\/autocad-get-field-edit-value-block-attribute\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Autocad- get to the field edit value of a block attribute - ELB Solutions.com Inc.\" \/>\n<meta property=\"og:description\" content=\"Well, this was like looking for a needle in a haystack. I tried to use google to know if a block attribute referred to text or to a formula that made the text. The key is looking at the extension dictionary. If there is one, it has dictionaries inside of them and if one of [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/elbsolutions.com\/projects\/autocad-get-field-edit-value-block-attribute\/\" \/>\n<meta property=\"og:site_name\" content=\"ELB Solutions.com Inc.\" \/>\n<meta property=\"article:published_time\" content=\"2014-10-08T20:40:41+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2022-02-03T17:25:00+00:00\" \/>\n<meta name=\"author\" content=\"Etienne Bley\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Etienne Bley\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/elbsolutions.com\\\/projects\\\/autocad-get-field-edit-value-block-attribute\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/elbsolutions.com\\\/projects\\\/autocad-get-field-edit-value-block-attribute\\\/\"},\"author\":{\"name\":\"Etienne Bley\",\"@id\":\"https:\\\/\\\/elbsolutions.com\\\/projects\\\/#\\\/schema\\\/person\\\/51e717c68f4f5917c63baf88f0896c39\"},\"headline\":\"Autocad- get to the field edit value of a block attribute\",\"datePublished\":\"2014-10-08T20:40:41+00:00\",\"dateModified\":\"2022-02-03T17:25:00+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/elbsolutions.com\\\/projects\\\/autocad-get-field-edit-value-block-attribute\\\/\"},\"wordCount\":171,\"articleSection\":[\"General\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/elbsolutions.com\\\/projects\\\/autocad-get-field-edit-value-block-attribute\\\/\",\"url\":\"https:\\\/\\\/elbsolutions.com\\\/projects\\\/autocad-get-field-edit-value-block-attribute\\\/\",\"name\":\"Autocad- get to the field edit value of a block attribute - ELB Solutions.com Inc.\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/elbsolutions.com\\\/projects\\\/#website\"},\"datePublished\":\"2014-10-08T20:40:41+00:00\",\"dateModified\":\"2022-02-03T17:25:00+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/elbsolutions.com\\\/projects\\\/#\\\/schema\\\/person\\\/51e717c68f4f5917c63baf88f0896c39\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/elbsolutions.com\\\/projects\\\/autocad-get-field-edit-value-block-attribute\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/elbsolutions.com\\\/projects\\\/autocad-get-field-edit-value-block-attribute\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/elbsolutions.com\\\/projects\\\/autocad-get-field-edit-value-block-attribute\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/elbsolutions.com\\\/projects\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Autocad- get to the field edit value of a block attribute\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/elbsolutions.com\\\/projects\\\/#website\",\"url\":\"https:\\\/\\\/elbsolutions.com\\\/projects\\\/\",\"name\":\"ELB Solutions.com Inc.\",\"description\":\"Bringing all your IT Pieces together\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/elbsolutions.com\\\/projects\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/elbsolutions.com\\\/projects\\\/#\\\/schema\\\/person\\\/51e717c68f4f5917c63baf88f0896c39\",\"name\":\"Etienne Bley\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/f8971dfb65b25b768415568f83247df4057f15d037137e386928a804e2c997b9?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/f8971dfb65b25b768415568f83247df4057f15d037137e386928a804e2c997b9?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/f8971dfb65b25b768415568f83247df4057f15d037137e386928a804e2c997b9?s=96&d=mm&r=g\",\"caption\":\"Etienne Bley\"},\"url\":\"https:\\\/\\\/elbsolutions.com\\\/projects\\\/author\\\/etienne-bley\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Autocad- get to the field edit value of a block attribute - ELB Solutions.com Inc.","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":"https:\/\/elbsolutions.com\/projects\/autocad-get-field-edit-value-block-attribute\/","og_locale":"en_US","og_type":"article","og_title":"Autocad- get to the field edit value of a block attribute - ELB Solutions.com Inc.","og_description":"Well, this was like looking for a needle in a haystack. I tried to use google to know if a block attribute referred to text or to a formula that made the text. The key is looking at the extension dictionary. If there is one, it has dictionaries inside of them and if one of [&hellip;]","og_url":"https:\/\/elbsolutions.com\/projects\/autocad-get-field-edit-value-block-attribute\/","og_site_name":"ELB Solutions.com Inc.","article_published_time":"2014-10-08T20:40:41+00:00","article_modified_time":"2022-02-03T17:25:00+00:00","author":"Etienne Bley","twitter_misc":{"Written by":"Etienne Bley","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/elbsolutions.com\/projects\/autocad-get-field-edit-value-block-attribute\/#article","isPartOf":{"@id":"https:\/\/elbsolutions.com\/projects\/autocad-get-field-edit-value-block-attribute\/"},"author":{"name":"Etienne Bley","@id":"https:\/\/elbsolutions.com\/projects\/#\/schema\/person\/51e717c68f4f5917c63baf88f0896c39"},"headline":"Autocad- get to the field edit value of a block attribute","datePublished":"2014-10-08T20:40:41+00:00","dateModified":"2022-02-03T17:25:00+00:00","mainEntityOfPage":{"@id":"https:\/\/elbsolutions.com\/projects\/autocad-get-field-edit-value-block-attribute\/"},"wordCount":171,"articleSection":["General"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/elbsolutions.com\/projects\/autocad-get-field-edit-value-block-attribute\/","url":"https:\/\/elbsolutions.com\/projects\/autocad-get-field-edit-value-block-attribute\/","name":"Autocad- get to the field edit value of a block attribute - ELB Solutions.com Inc.","isPartOf":{"@id":"https:\/\/elbsolutions.com\/projects\/#website"},"datePublished":"2014-10-08T20:40:41+00:00","dateModified":"2022-02-03T17:25:00+00:00","author":{"@id":"https:\/\/elbsolutions.com\/projects\/#\/schema\/person\/51e717c68f4f5917c63baf88f0896c39"},"breadcrumb":{"@id":"https:\/\/elbsolutions.com\/projects\/autocad-get-field-edit-value-block-attribute\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/elbsolutions.com\/projects\/autocad-get-field-edit-value-block-attribute\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/elbsolutions.com\/projects\/autocad-get-field-edit-value-block-attribute\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/elbsolutions.com\/projects\/"},{"@type":"ListItem","position":2,"name":"Autocad- get to the field edit value of a block attribute"}]},{"@type":"WebSite","@id":"https:\/\/elbsolutions.com\/projects\/#website","url":"https:\/\/elbsolutions.com\/projects\/","name":"ELB Solutions.com Inc.","description":"Bringing all your IT Pieces together","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/elbsolutions.com\/projects\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/elbsolutions.com\/projects\/#\/schema\/person\/51e717c68f4f5917c63baf88f0896c39","name":"Etienne Bley","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/f8971dfb65b25b768415568f83247df4057f15d037137e386928a804e2c997b9?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/f8971dfb65b25b768415568f83247df4057f15d037137e386928a804e2c997b9?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/f8971dfb65b25b768415568f83247df4057f15d037137e386928a804e2c997b9?s=96&d=mm&r=g","caption":"Etienne Bley"},"url":"https:\/\/elbsolutions.com\/projects\/author\/etienne-bley\/"}]}},"_links":{"self":[{"href":"https:\/\/elbsolutions.com\/projects\/wp-json\/wp\/v2\/posts\/908","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/elbsolutions.com\/projects\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/elbsolutions.com\/projects\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/elbsolutions.com\/projects\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/elbsolutions.com\/projects\/wp-json\/wp\/v2\/comments?post=908"}],"version-history":[{"count":3,"href":"https:\/\/elbsolutions.com\/projects\/wp-json\/wp\/v2\/posts\/908\/revisions"}],"predecessor-version":[{"id":2779,"href":"https:\/\/elbsolutions.com\/projects\/wp-json\/wp\/v2\/posts\/908\/revisions\/2779"}],"wp:attachment":[{"href":"https:\/\/elbsolutions.com\/projects\/wp-json\/wp\/v2\/media?parent=908"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/elbsolutions.com\/projects\/wp-json\/wp\/v2\/categories?post=908"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/elbsolutions.com\/projects\/wp-json\/wp\/v2\/tags?post=908"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}