Joined: Oct 23, 2022
Post Count: 5
Status:
Offline
New feature: Caption
Hi everyone,
I would like to present you a new feature for Sweet Home 3D called "Caption".
I use the Sweet Home 3D while building my own house. One of the next steps in my house is the mounting of electrical equipment. For the electrical equipment like switches it's important to see an elevation on the 2D sheet but I've found no easy way to place it to the plan. So I have added this feature myself.
I've added the ability to add any caption to any furniture. It also supports a templated text, for example, you can use $ELEVATION to place to target furniture elevation or $NAME to place the name.
I will be glad to answer any questions you have about it. I would also like to contribute the Sweet Home 3D if you find this feature useful. Please give some contribution guides.
France
Joined: Nov 7, 2005
Post Count: 9418
Status:
Offline
Re: New feature: Caption
Nice proposal Vasilij. You can post a source code patch in a feature request ticket if you want. Hans, I fear this can't be transformed as a plug-in because it changes the behavior of the plan and how it's drawn.
----------------------------------------
Emmanuel Puybaret, Sweet Home 3D creator
Joined: Oct 23, 2022
Post Count: 5
Status:
Offline
Re: New feature: Caption
Writing a plugin was my first thought. But Emmanuel is right, the plugins API seems not enough to implement this as a plugin.
Thank you for the feature requests link. I would definitely like to post a patch. Emmanuel, can I message you directly in the case of questions about a feature request?
France
Joined: Nov 7, 2005
Post Count: 9418
Status:
Offline
Re: New feature: Caption
Any chance it gets a place in SH3D v8 ??
That would imply quite a lot of changes because changing how user interface components are displayed and behave should be feasible from more than a plug-in. And I'm not sure it would be such a good idea, because such plug-ins would have to always interact nicely with the default behavior of the program and other plug-ins.
Vasilij, don't hesitate to write me directly and sorry if I didn't answer faster to your last mail.
----------------------------------------
Emmanuel Puybaret, Sweet Home 3D creator
Italy
Joined: Nov 17, 2021
Post Count: 440
Status:
Offline
Re: New feature: Caption
I think this could be programmed as a plugin using the standard API. I'm not saying this would be easy, but I'm sure it can be done.
Here some tips: a) The monitoring of furniture properties like name and elevation can be monitored by attaching listeners. b) From a graphical point of view you need only basic elements, i.e. the polyline and the label. c) The label and polyline can be logically linked to a furniture using the custom properties. d) The label position relative to the furniture can be saved using custom properties. e) as a furniture moves the polyline and label position can be changed accordingly using a listener (as at point A).
If you look at the "Link selected furniture" feature from the Wirings plugin you can get an idea of how it cloud be done in a plugin. Watch the last part of the following video, you will see polylines that follow a furniture: https://youtu.be/Z_XFq4QaD8E
Joined: Oct 23, 2022
Post Count: 5
Status:
Offline
Re: New feature: Caption
Hello Daniels,
Thank you for the reply. I made one more try with a plugin. I've downloaded the Wirings plugin and explored this a little bit. I still have some questions, can you please help with this? - If I understand correctly, the Wirings plugin is built upon the "polyline" feature so the core part of SH3D knows how to handle it. The new feature requires new drawings and I've found no API to do this. Have I missed something? How can I draw a 2D graphics I need? - The saving and reading home elements is also hard for a new types of elements, I've also found no API to do this.
If you have ideas on how I can implement this in a plugin, please share 🙂 I would be glad to make a plugin