# Error when saving Bounds2DComponent (serialization error)

**URL:** <https://forum.inductiveautomation.com/t/error-when-saving-bounds2dcomponent-serialization-error/96276>\
**Category:** Module Development\
**Tags:** vision\
**Created:** [September 21, 2024, 11:10am UTC](https://forum.inductiveautomation.com/t/error-when-saving-bounds2dcomponent-serialization-error/96276 "2024-09-21T11:10:11Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![Mathias\_Melling](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mathias_melling/32/67682_2.png) [@Mathias\_Melling](https://forum.inductiveautomation.com/u/Mathias_Melling)\
**Post date:** [September 23, 2024, 2:09pm UTC](https://forum.inductiveautomation.com/t/error-when-saving-bounds2dcomponent-serialization-error/96276/5 "2024-09-23T14:09:29Z")

</div>

Hi Bohdan,

I've been building my components by extending the `AbstractVisionShape` class, which itself is an extension of `AbstractVisionComponent` and it also implements the `Bounds2DComponent` interface. Maybe that's the way to go for you as well, instead of trying to implement `Bounds2DComponent` yourself.

As to your question here:

> [@Vision Component Size restrictions](https://forum.inductiveautomation.com/t/vision-component-size-restrictions/83103/30):
>
> Hi Mathias, Could you please have a look at: [Error-When-Saving-Bounds2DComponent (Serialization error)](https://forum.inductiveautomation.com/t/error-when-saving-bounds2dcomponent-serialization-error/96276) It is related to what Max is trying to do too. I am asking you since you mentioned about need of boundingRect property... something I suspect I am doing wrong (any particular flags must be set for it to work, e.g. when using addProp(..) in the BeanInfo?). Any chance you can advice how exactly that property needs to be added and if you aware of anything else needed for such component to be sa…

I add the `boundingRect` property just like any other property:

```python
addProp("boundingRect",
		"Bounds",
		"Bounding rectangle of the component.",
		CAT_POSITION,
		HIDDEN_MASK);

```

I use the HIDDEN\_MASK, because there is no need for this property to be visible. It is only necessary for serialization.

---

_[View the full topic](https://forum.inductiveautomation.com/t/error-when-saving-bounds2dcomponent-serialization-error/96276)._
