{"action":"created","issue":{"url":"https://api.github.com/repos/jmwright/cadquery-freecad-module/issues/41","labels_url":"https://api.github.com/repos/jmwright/cadquery-freecad-module/issues/41/labels{/name}","comments_url":"https://api.github.com/repos/jmwright/cadquery-freecad-module/issues/41/comments","events_url":"https://api.github.com/repos/jmwright/cadquery-freecad-module/issues/41/events","html_url":"https://github.com/jmwright/cadquery-freecad-module/issues/41","id":53672937,"number":41,"title":"\"Measure distance\" Objects in Feature Tree Cause Script Not to Execute","user":{"login":"jmwright","id":1015439,"avatar_url":"https://avatars.githubusercontent.com/u/1015439?v=3","gravatar_id":"","url":"https://api.github.com/users/jmwright","html_url":"https://github.com/jmwright","followers_url":"https://api.github.com/users/jmwright/followers","following_url":"https://api.github.com/users/jmwright/following{/other_user}","gists_url":"https://api.github.com/users/jmwright/gists{/gist_id}","starred_url":"https://api.github.com/users/jmwright/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jmwright/subscriptions","organizations_url":"https://api.github.com/users/jmwright/orgs","repos_url":"https://api.github.com/users/jmwright/repos","events_url":"https://api.github.com/users/jmwright/events{/privacy}","received_events_url":"https://api.github.com/users/jmwright/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/jmwright/cadquery-freecad-module/labels/bug","name":"bug","color":"fc2929"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-01-07T19:42:49Z","updated_at":"2015-01-08T03:52:10Z","closed_at":null,"body":"If you click \"Measure distance\" and measure something, the next time you hit F2 you'll get the following error.\r\n```python\r\nTraceback (most recent call last):\r\n  File \"/usr/lib/freecad/Mod/CadQuery/Gui/Command.py\", line 121, in Activated\r\n    clearActiveDocument()\r\n  File \"/usr/lib/freecad/Mod/CadQuery/Gui/Command.py\", line 24, in clearActiveDocument\r\n    doc.removeObject(obj.Label)\r\n\r\nNo document object found with name 'Distance: 48.962'\r\n```\r\nIf you delete the distance from the feature tree manually, the error goes away and the script executes.\r\n\r\nA modification needs to be made so that distances are cleared automatically by the module before letting FreeCAD try to clear the active document."},"comment":{"url":"https://api.github.com/repos/jmwright/cadquery-freecad-module/issues/comments/69132506","html_url":"https://github.com/jmwright/cadquery-freecad-module/issues/41#issuecomment-69132506","issue_url":"https://api.github.com/repos/jmwright/cadquery-freecad-module/issues/41","id":69132506,"user":{"login":"jmwright","id":1015439,"avatar_url":"https://avatars.githubusercontent.com/u/1015439?v=3","gravatar_id":"","url":"https://api.github.com/users/jmwright","html_url":"https://github.com/jmwright","followers_url":"https://api.github.com/users/jmwright/followers","following_url":"https://api.github.com/users/jmwright/following{/other_user}","gists_url":"https://api.github.com/users/jmwright/gists{/gist_id}","starred_url":"https://api.github.com/users/jmwright/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jmwright/subscriptions","organizations_url":"https://api.github.com/users/jmwright/orgs","repos_url":"https://api.github.com/users/jmwright/repos","events_url":"https://api.github.com/users/jmwright/events{/privacy}","received_events_url":"https://api.github.com/users/jmwright/received_events","type":"User","site_admin":false},"created_at":"2015-01-08T03:52:10Z","updated_at":"2015-01-08T03:52:10Z","body":"Looks like if you check two distances, you'd need the following two lines to get rid of both of them.\r\n```python\r\nApp.getDocument(\"example\").removeObject(\"Distance\")\r\nApp.getDocument(\"example\").removeObject(\"Distance001\")\r\n```\r\nI would consider that a bug in FreeCAD's clearActiveDocument function that it uses the distance value as part of the name rather than what the distances actually get named in the feature tree."}}