Error: #<TypeError: reference to deleted Entity>
-
Noticed the following in the Ruby console when working on an extension.
Error: #<TypeError: reference to deleted Entity>
c:/users/.../appdata/roaming/sketchup/sketchup 2017/sketchup/plugins/su_dynamiccomponents/ruby/dcobservers.rbe:908:inget_attribute' c:/users/.../appdata/roaming/sketchup/sketchup 2017/sketchup/plugins/su_dynamiccomponents/ruby/dcobservers.rbe:908:in
onActivePathChanged'At first I assumed an error in my extension but it was easily replicated in a fresh start of SU.
Steps: Create some geometry, add it to a group or component. Open the group or component for editing, select all and delete. Then click anywhere on the screen and the the above appears in the console.
Doesn't seem to have any other side effects.
Note: I am on make, so no dynamic components...
Bryan
-
Fredo reported this a while ago.
With recent versions if you have a reference set up for an entity etc and it gets recreated - e.g. during an explode - the reference changes and so there's an error as some code finds an invalid reference.
Most developers have now trapped for this in their code - e.g. setting a reference to an entity does not persist after an operation like explode, so you need to grep the result of the explode to re-collect the object[s] to re-find that entity - using persistent-id or a custom attribute assigned to the entity...
In older versions an explode etc did not destroy the reference to an entity, so your code could reference it inside a group and find it again after the explode... the persistent-id changes broke this and a workaround is needed, as explained.
I suspect that the old DC code has not been fully updated to avoid the 'delete entity' reference messages...
It's a straightforward fix to trap for it - but SketchUp seems unwilling to devote much time to DCs - they have new fish to fry...
Advertisement