Print at Dec 22, 2025, 1:39:38 AM

Posted by Keet at Dec 10, 2024, 10:08:38 AM
Re: Wishlist: Fast house Creator
"Why simple when it can be complicated?"
If you want to just enter the four corners of a room and the number and height of levels that is extremely easy to do.

Save a new empty project and close it. Extract the Home.xml file from the .sh3d file. It will look like this:
<?xml version='1.0'?>
<home version='7400' name='template.sh3d' camera='topCamera' selectedLevel='level-466d6260-f5f6-4552-bdb9-d2c355c39cd6' wallHeight='250.0'>
<property name='com.eteks.sweethome3d.SweetHome3D.CatalogPaneDividerLocation' value='240'/>
<property name='com.eteks.sweethome3d.SweetHome3D.ColumnWidths' value='231,79,67,43,43'/>
<property name='com.eteks.sweethome3d.SweetHome3D.ExpandedGroups' value=''/>
<property name='com.eteks.sweethome3d.SweetHome3D.FrameHeight' value='844'/>
<property name='com.eteks.sweethome3d.SweetHome3D.FrameMaximized' value='true'/>
<property name='com.eteks.sweethome3d.SweetHome3D.FrameWidth' value='1162'/>
<property name='com.eteks.sweethome3d.SweetHome3D.FrameX' value='0'/>
<property name='com.eteks.sweethome3d.SweetHome3D.FrameY' value='52'/>
<property name='com.eteks.sweethome3d.SweetHome3D.MainPaneDividerLocation' value='468'/>
<property name='com.eteks.sweethome3d.SweetHome3D.PlanPaneDividerLocation' value='522'/>
<property name='com.eteks.sweethome3d.SweetHome3D.PlanScale' value='0.03607176'/>
<property name='com.eteks.sweethome3d.SweetHome3D.PlanViewportX' value='0'/>
<property name='com.eteks.sweethome3d.SweetHome3D.PlanViewportY' value='0'/>
<property name='com.eteks.sweethome3d.SweetHome3D.ScreenHeight' value='1055'/>
<property name='com.eteks.sweethome3d.SweetHome3D.ScreenWidth' value='1920'/>
<property name='com.eteks.sweethome3d.swing.PhotoPanel.PhotoDialogHeight' value='593'/>
<property name='com.eteks.sweethome3d.swing.PhotoPanel.PhotoDialogWidth' value='424'/>
<property name='com.eteks.sweethome3d.swing.PhotoPanel.PhotoDialogX' value='745'/>
<property name='com.eteks.sweethome3d.swing.PhotoPanel.PhotoDialogY' value='228'/>
<furnitureVisibleProperty name='NAME'/>
<furnitureVisibleProperty name='WIDTH'/>
<furnitureVisibleProperty name='DEPTH'/>
<furnitureVisibleProperty name='HEIGHT'/>
<furnitureVisibleProperty name='VISIBLE'/>
<environment groundColor='FF91634F' skyColor='00CCE4FC' lightColor='00D0D0D0' ceillingLightColor='00D0D0D0' photoWidth='400' photoHeight='228' photoAspectRatio='VIEW_3D_RATIO' photoQuality='2' videoWidth='320' videoAspectRatio='RATIO_4_3' videoQuality='0' videoFrameRate='25'/>
<compass x='-100.0' y='50.0' diameter='100.0' northDirection='0.0' longitude='0.08581202' latitude='0.91367984' timeZone='Europe/Amsterdam' visible='false'/>
<observerCamera attribute='observerCamera' lens='PINHOLE' x='50.0' y='50.0' z='170.0' yaw='5.4977875' pitch='0.19634955' fieldOfView='1.0995575' time='1708344000000'/>
<camera attribute='topCamera' lens='PINHOLE' x='216.28342' y='3069.0542' z='1843.0659' yaw='3.0865703' pitch='0.545' fieldOfView='1.0995575' time='1708333200154'/>
<level id='level-466d6260-f5f6-4552-bdb9-d2c355c39cd6' name='Level 1' elevation='0.0' floorThickness='20.0' height='250.0' elevationIndex='1'/>
</home>

Remove the line with the level and replace it with a place holder, something like "###" or whatever you think looks fancy. Save it and rename the file to "housetemplate.xml".

Create a script that receives the parameters for the 4 room corners, the level height, and the number of levels.
In the script write a memory string or string variable creating the number of level lines according to the parameter for the number of levels and the height parameter. That will create the levels for a home. You will have to calculate the elevations using the level height and floor thickness for each consecutive level. The level id's must be unique for each level but can be as simple as "level-001".

A room definition looks like this:
<room id='room-0f3253ce-86f9-4286-97df-beaae4a53ece' level='level-466d6260-f5f6-4552-bdb9-d2c355c39cd6' ceilingVisible='true' ceilingFlat='true'>
<point x='0.0' y='0.0'/>
<point x='1000.0' y='0.0'/>
<point x='1000.0' y='500.0'/>
<point x='0.0' y='500.0'/>
</room>

For each level add a room definition to the memory string using the room parameters to set the point values.

Open the "housetemplate.xml" file and update the top line: set "selectedLevel" to the id you generated for the first level and set "wallHeight" to the level height parameter value.
Replace the place holder with the content of the memory string and save it as "Home.xml". Zip the Home.xml file with a name of your choice and the extension .sh3d. You can open this in Sweet Home 3D and it will have all the levels and rooms as defined. Save it and the missing "Home" file will be created in the .sh3d file.

Voila, you have your 'house' created with the parameters passed to your script. Since it's basically all file and string manipulation you can use any script or programming language you want.

Personally I think it's pretty useless because very soon a user will want to add more parameters to refine the process. Different level heights, multiple different rooms, add the walls, etc. etc.
That will quickly escalate to something like.... Sweet Home 3D laughing
----------------------------------------
Dodecagon.nl
1300+ 3D models, manuals, and projects