# Tagging component as dynamic

**URL:** <https://forum.visualcomponents.com/t/tagging-component-as-dynamic/405>\
**Category:** Python Programming\
**Created:** [July 6, 2018, 10:28am UTC](https://forum.visualcomponents.com/t/tagging-component-as-dynamic/405 "2018-07-06T10:28:37Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![anon20723248](https://forum.visualcomponents.com/letter_avatar_proxy/v4/letter/a/b77776/32.png) [@anon20723248](https://forum.visualcomponents.com/u/anon20723248)\
**Post date:** [July 6, 2018, 10:28am UTC](https://forum.visualcomponents.com/t/tagging-component-as-dynamic/405/1 "2018-07-06T10:28:37Z")

</div>

Hi,

Is there a way to tag a component as “Dynamic”?

The reason for my question is that I sometimes use app.CloneComponent() during the simulation but those components are not always deleted after I hit the reset button. So if I could tag the component as dynamic it would be deleted after I reset the simulation.

Thanks!

---

<div class="post-metadata">

**Author:** ![WilliamSmith](https://forum.visualcomponents.com/user_avatar/forum.visualcomponents.com/williamsmith/32/5471_2.png) [@WilliamSmith](https://forum.visualcomponents.com/u/WilliamSmith)\
**Post date:** [July 6, 2018, 2:10pm UTC](https://forum.visualcomponents.com/t/tagging-component-as-dynamic/405/2 "2018-07-06T14:10:15Z")

</div>

Every vcComponent has a CreationTime property. Try this code with a feeder and conveyor template. Static components should have a creation time of zero.

```
from vcScript import *

def tag(comp,container,added):
  print comp.CreationTime

app = getApplication()
for c in app.Components:
  print c.CreationTime
  
app.OnDynamicComponent = tag
```

With that, there is the option to stamp every dynamic component with a property that identifies it as dynamic.

---

<div class="post-metadata">

**Author:** ![anon20723248](https://forum.visualcomponents.com/letter_avatar_proxy/v4/letter/a/b77776/32.png) [@anon20723248](https://forum.visualcomponents.com/u/anon20723248)\
**Post date:** [July 6, 2018, 4:26pm UTC](https://forum.visualcomponents.com/t/tagging-component-as-dynamic/405/3 "2018-07-06T16:26:32Z")

</div>

Thanks, this is very usefull!
