Error: #<TypeError: reference to deleted Entity>  Topic is solved

Found a bug in SketchUp? Report it here

Error: #<TypeError: reference to deleted Entity>

Postby BryanHL » Fri Nov 13, 2020 8:33 am

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:in `get_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
0

BryanHL 
 

Re: Error: #<TypeError: reference to deleted Entity>  Topic is solved

Postby TIG » Fri Nov 13, 2020 4:07 pm

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...
0
TIG
User avatar
TIG 
Global Moderator
 

SketchUcation One-Liner Adverts

by Ad Machine » 5 minutes ago



Ad Machine 
Robot
 



 

Return to SketchUp Bug Reporting

Who is online

Users browsing this forum: No registered users and 5 guests

Visit our sponsors: