Print at Dec 18, 2025, 3:42:56 AM View all posts in this thread on one page
Posted by honzik at Nov 3, 2022, 1:54:22 PM
Parametrically defined or scripted home
Hello,

first of all, thanks a lot for this amazing program!

I would like to use SweetHome3D "parametrically".
As a minimum example, assume a rectangular room surrounded by walls.
I would like to have an option to resize the room based on given dimensions (width and height), without a need to redraw it manually.

In reality, I would have many such rooms and walls, stacked together, dimensions of each room being independent parameter and I would like to define these parameters and see the result "easily" (without manual redrawing).
In an extreme case, the home would be "scripted".

Is it somehow possible currently?

If no, I would create a Python tool for this kind of scripting, producing a XML file loadable by SweetHome3D.
Would anybody be interested in such feature?
Just if I should publish the code once it is eventually finished.

Thanks
Jan

Posted by hansmex at Nov 4, 2022, 7:55:19 AM
Re: Parametrically defined or scripted home
Even if only as a thought experiment, it would be interesting to see how such a script would work.
It seems to me relatively easy to define a set of rooms with a few basic parameters, but how would you define the placement of rooms relative to each other?

Recently, I've played around a bit with AI generators, and although they produce something that vaguely resembles a house, they're impossible to live in because of the haphazard orientation of the rooms.

H
----------------------------------------
Hans

new website - under constuction
hansdirkse.info

Posted by Puybaret at Nov 4, 2022, 3:11:51 PM
Re: Parametrically defined or scripted home
Jan, why not trying to program your idea in Java from a plug-in? You would have no need to generate a SH3D file, just have to call Sweet Home 3D API.
----------------------------------------
Emmanuel Puybaret, Sweet Home 3D creator

Posted by honzik at Nov 7, 2022, 8:15:28 AM
Re: Parametrically defined or scripted home

Even if only as a thought experiment, it would be interesting to see how such a script would work.
It seems to me relatively easy to define a set of rooms with a few basic parameters, but how would you define the placement of rooms relative to each other?

Recently, I've played around a bit with AI generators, and although they produce something that vaguely resembles a house, they're impossible to live in because of the haphazard orientation of the rooms.

H

Thanks for the reply.

The placement of the rooms would be defined basically as "first wall width + first room width + second wall width + second room width + ...".
I did not meant automatic room placement.

As an example, I have a long hall (hallway, corridor, ...) with several rooms on one side. My use case would be something like:
- what if I switch these two rooms (which would shift all other rooms and would need complete redrawing), how would it look like?
- what if I enlarge this and this room and make this room smaller, what would it look like?
- ...

Posted by honzik at Nov 7, 2022, 8:26:51 AM
Re: Parametrically defined or scripted home

Jan, why not trying to program your idea in Java from a plug-in? You would have no need to generate a SH3D file, just have to call Sweet Home 3D API.


Thanks for the reply.

Using Java and the SweetHome3D API, I am able to create a home programatically and save it, so basically what I was looking for, thanks for the tip.

Still maybe I will play with the possibility to use Python :-) but it is a secondary problem, left for my leisure time.

Thanks
Jan