# Dynamic Component Error

**URL:** <https://forums.sketchup.com/t/dynamic-component-error/70699>\
**Category:** Ruby API\
**Tags:** components\
**Created:** [June 20, 2018, 3:34pm UTC](https://forums.sketchup.com/t/dynamic-component-error/70699 "2018-06-20T15:34:18Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![jb\_Trystram](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@jb\_Trystram](https://forums.sketchup.com/u/jb_Trystram)\
**Post date:** [June 20, 2018, 3:34pm UTC](https://forums.sketchup.com/t/dynamic-component-error/70699/1 "2018-06-20T15:34:18Z")

</div>

Hello,  
I’m working on Plug-ins that use DC and i get often this error. this is an error from su\_dynamiccomponents and i can’t do nothing again, not even understand what’s going on. it makes the component window not showing the parameter.

Error: #\<NoMethodError: undefined method `deleted?' for #<Sketchup::Model:0x007fc7fd95c938>> /users/jbt/library/application support/sketchup 2018/sketchup/plugins/su_dynamiccomponents/ruby/dcclass_overlays.rbe:212:in `block in pull\_attribute\_tree’  
/users/jbt/library/application support/sketchup 2018/sketchup/plugins/su\_dynamiccomponents/ruby/dcclass\_overlays.rbe:212:in `delete_if' /users/jbt/library/application support/sketchup 2018/sketchup/plugins/su_dynamiccomponents/ruby/dcclass_overlays.rbe:212:in `pull\_attribute\_tree’  
/users/jbt/library/application support/sketchup 2018/sketchup/plugins/su\_dynamiccomponents/ruby/dcclass\_v1.rbe:245:in `block in show_dialog' SketchUp:1:in `call’

---

<div class="post-metadata">

**Author:** ![Aerilius](https://avatars.discourse-cdn.com/v4/letter/a/e19b73/32.png) [@Aerilius](https://forums.sketchup.com/u/Aerilius)\
**Post date:** [June 20, 2018, 3:51pm UTC](https://forums.sketchup.com/t/dynamic-component-error/70699/2 "2018-06-20T15:51:05Z")

</div>

It looks like it checks whether an entity reference is valid (entity not deleted) before reading attributes from it. However a model is not a normal entity and cannot be deleted, but it can have attributes. Somehow the model gets into the list of entities that are considered.

Since the backtrace does not reference lines of your code, the error is probably triggered by the dynamiccomponents code which could be invoked by observers. But the original cause could still be in your code (if not a bug in dynamiccomponents).

- Does this still happen when you cleanly restart SketchUp, open the same model and run once your plugin? Maybe the model got into a bad state after several tests of your plugin.
- It would be helpful to understand what your plugin does, how it interacts with dynamiccomponents and whether it somehow injects entities (or the model) into the list of entities that dynamic components are working with.
- Dynamiccomponents have no public, stable API that is intended to be used by Ruby programmers. If there is no API, there are no guarantees and if a developer regardlessly uses internal methods it is very risky because he cannot be sure to fully understand the inner workings for all inputs and in all situations of use.

---

<div class="post-metadata">

**Author:** ![DanRathbun](https://sea2.discourse-cdn.com/sketchup/user_avatar/forums.sketchup.com/danrathbun/32/500_2.png) [@DanRathbun](https://forums.sketchup.com/u/DanRathbun)\
**Post date:** [June 20, 2018, 4:06pm UTC](https://forums.sketchup.com/t/dynamic-component-error/70699/3 "2018-06-20T16:06:37Z")

</div>

**Already reported in the DC errors thread, over 3 years ago !**  
(_And was actually discussed some years before this_.)

- [Ruby Errors in Dynamic Components : post 2](https://forums.sketchup.com/t/ruby-errors-in-dynamic-components/11530/2)

And I posted a “bandage snippet” further down the thread …

- [Ruby Errors in Dynamic Components : post 11](https://forums.sketchup.com/t/ruby-errors-in-dynamic-components/11530/11)

---

<div class="post-metadata">

**Author:** ![jb\_Trystram](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@jb\_Trystram](https://forums.sketchup.com/u/jb_Trystram)\
**Post date:** [June 20, 2018, 4:34pm UTC](https://forums.sketchup.com/t/dynamic-component-error/70699/4 "2018-06-20T16:34:38Z")

</div>

Hi Aurelius,

It doesn’t happen when i restart SU.  
I made this Plug-ins in 2011-12 and it worked all the times (used by 4-5 people everyday). you can see what it does hier: [VectorWorks Plug-in – Jean Baptiste Trystram – GALADES](http://www.galades.com/portfolio/Soft_SketchUp/)  
i first make it working for 2018 because it didn’t. it works (actually it still work with this error but with empty parameter window). now i have to adapt the PI to the change made on the product it draws.  
as you say it could come from my script but i have no way to see where. and it should  
Dynamic components have no public, stable API ??? but it comes with the pro version !!  
thanks for the answer,  
Jean Baptiste

---

<div class="post-metadata">

**Author:** ![DanRathbun](https://sea2.discourse-cdn.com/sketchup/user_avatar/forums.sketchup.com/danrathbun/32/500_2.png) [@DanRathbun](https://forums.sketchup.com/u/DanRathbun)\
**Post date:** [June 20, 2018, 4:38pm UTC](https://forums.sketchup.com/t/dynamic-component-error/70699/5 "2018-06-20T16:38:49Z")

</div>

@jb_Trystram

Jean Baptiste, … See my post just [above your last post](https://forums.sketchup.com/t/dynamic-component-error/70699/3).

It is a long-standing bug with the Dynamic Components code, not your plugin.

---

<div class="post-metadata">

**Author:** ![jb\_Trystram](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@jb\_Trystram](https://forums.sketchup.com/u/jb_Trystram)\
**Post date:** [June 20, 2018, 4:50pm UTC](https://forums.sketchup.com/t/dynamic-component-error/70699/6 "2018-06-20T16:50:26Z")

</div>

Hello Dan,  
I look at your post and i ask me the same Question : it’s somebody by Trimble in charge of DC?

---

<div class="post-metadata">

**Author:** ![DanRathbun](https://sea2.discourse-cdn.com/sketchup/user_avatar/forums.sketchup.com/danrathbun/32/500_2.png) [@DanRathbun](https://forums.sketchup.com/u/DanRathbun)\
**Post date:** [June 20, 2018, 4:56pm UTC](https://forums.sketchup.com/t/dynamic-component-error/70699/7 "2018-06-20T16:56:43Z")

</div>

> [@jb\_Trystram](#):
>
> somebody by Trimble in charge of DC?

I do not know exactly who is responsible for the Dynamic Components extension.

I’ve reported multiple bugs (to whom I believe _should be_ responsible,) and have received _mostly_ silence back.

The only thing more we can do, is to start sending our complaints to product management …

@jbacus @tyler_miller
