# Component's custom property in python class

**URL:** <https://forum.inductiveautomation.com/t/components-custom-property-in-python-class/64427>\
**Category:** Ignition\
**Tags:** ignition80, vision, scripting\
**Created:** [September 23, 2022, 4:14pm UTC](https://forum.inductiveautomation.com/t/components-custom-property-in-python-class/64427 "2022-09-23T16:14:21Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![kaushik.shah](https://avatars.discourse-cdn.com/v4/letter/k/34f0e0/32.png) [@kaushik.shah](https://forum.inductiveautomation.com/u/kaushik.shah)\
**Post date:** [September 23, 2022, 4:14pm UTC](https://forum.inductiveautomation.com/t/components-custom-property-in-python-class/64427/1 "2022-09-23T16:14:21Z")

</div>

Hello There,

I am trying to access custom property of the component in scripting but seems like I can’t access it somehow as Ignition throws attribute error.

When I do something like this, it works completely fine :

```auto
self.root = self.window.rootContainer.getComponent('PartNumberAndCompound')
for i in range(self.maximumNoOfBatches):
			self.root.getComponent('batch_number_%d'%(i)).intValue = 0

```

but when I try to set the custom property,  
`self.root.getComponent('batch_number_%d'%(i)).mixer_batch_history_id= 0`  
it throws following error :

```auto
Traceback (most recent call last):
  File "<event:propertyChange>", line 12, in <module>
  File "<module:shared.mixing.SAP>", line 336, in calculateWeights
AttributeError: 'com.inductiveautomation.factorypmi.application.com' object has no attribute 'mixer_batch_history_id'

```

Is this the intended behavior ? if so, how can I access custom property ?

Thank you so much for the help in advance

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [September 23, 2022, 11:03pm UTC](https://forum.inductiveautomation.com/t/components-custom-property-in-python-class/64427/2 "2022-09-23T23:03:07Z")

</div>

There is a long-standing flaw in Vision's delivery of a `PyComponentWrapper`--that is, it only delivers a fully-functional component from certain component methods.

For other cases, the work-around is to install my [Simulation Aids](https://inductiveautomation.com/moduleshowcase/module/automation-professionals-llc-simulation-aids) module, which inserts a jython adapter to ensure Vision components are always properly wrapped.

If you want the gory details, read this entire topic:

> [@Transaction groups triggered expression item updating when trigger is false](https://forum.inductiveautomation.com/t/transaction-groups-triggered-expression-item-updating-when-trigger-is-false/17196):
>
> Having a transaction group with triggered expression/SQL items and a run always expression item used as trigger for the group. When the trigger (run always item) references any of the triggered items, these updates even though the trigger is false. Is there any way to stop this behavior as the triggered items stores relevant information I need between triggers?

{ The flaw affects access to custom component **methods** , too. }

---

<div class="post-metadata">

**Author:** ![kaushik.shah](https://avatars.discourse-cdn.com/v4/letter/k/34f0e0/32.png) [@kaushik.shah](https://forum.inductiveautomation.com/u/kaushik.shah)\
**Post date:** [September 29, 2022, 11:16am UTC](https://forum.inductiveautomation.com/t/components-custom-property-in-python-class/64427/3 "2022-09-29T11:16:12Z")

</div>

I see. I am giving it a shot.
