Print at Dec 23, 2025, 7:04:21 AM
Posted by Fargo1 at Jan 19, 2013, 6:37:04 PM
Area calculation and auto dimensions for 2D
I would like to use SweetHome2D for drawing house sketches for my Real Estate work. I prefer only 2D, but I need the ability to calculate the sq ft area of the property. It would also be nice if there was a way to set the dimensions to automatically measure the outside walls. Then I could just draw each level of the house and have all my calculations measured for me. Then I could export a copy to the clipboard or pdf that would show the 2d floorplan and all area calculations.

For an example look at PhoenixMobile.com If you download a copy and play with it, you will see how the dimension are automatically shown and area is automatically calculated when the floor is closed. Then I can simply add room labels and export file. If you download a copy and export to pdf you will see how it prints a calculation page as well as how it shows the area sq ft. I need something like this software. I am trying to move my business over to Linux. Thank you.

Posted by hansmex at Jan 20, 2013, 5:42:04 AM
Re: Area calculation and auto dimensions for 2D
What can you do with SH3D?

1 - Print to a page or to a PDF file that includes:
--> a 2D plan, which can include the name and surface area (in sq.ft. or sq.m.) of each room
--> a 3D view, which shows the house from a bird's eye view, or through the "eyes" of a virtual visitor
--> a furniture list, that sums up every item of furniture that you have added to the design.
1a - Through File --> Page setup you can select which of these three items should be included in your report.
1b - Note that room dimensions are calculated from the inside measurements of the room. If doors are inserted before the room is drawn, half the surface under the door will be added to the room surface.

2 - There is a plug-in available that adds the function Tools --> Compute walls' area.
This function will calculate the area of the selected walls. Note that the wall surface will be calculated based on the center line dimensions of the wall. This means that the resulting number will be too great for inside walls, too small for outside walls. Sloping walls are correctly calculated, albeit also along the center line.

What can you NOT do with SH3D?
SH3D will not automagically make a list of all rooms and surfaces and include that in your report. You can easily use (e.g.) LibreOffice for that, which can generate a PDF file from both its text processor and spreadsheet program.
Please, bear in mind that SH3D was designed first and for all as an interior decorating program. Although I am not the developer of this program, I do not think that, currently, there are plans to implement a function like the one you described.

Hans
----------------------------------------
Hans

new website - under constuction
hansdirkse.info

Posted by Puybaret at Jan 20, 2013, 6:25:12 PM
Re: Area calculation and auto dimensions for 2D
I need the ability to calculate the sq ft area of the property
Even if it's not really a feature, you can create a room that will measure the total area of a home (including the area or the walls on the ground) by double clicking on an exterior wall with the Room creation tool.

It would also be nice if there was a way to set the dimensions to automatically measure the outside walls.
Such a feature doesn't exist, but in case you didn't know, the Dimension creation tool lets you create dimensions tool by simply double clicking along the walls you want to measure.
----------------------------------------
Emmanuel Puybaret, Sweet Home 3D creator

Posted by Fargo1 at Jan 21, 2013, 11:37:24 PM
Re: Area calculation and auto dimensions for 2D
Thanks guys. I tried the method Puybaret recommended and this gets me close. If I could move the dimensions to the outside of the wall, place the calculated living area outside of the room and include a breakdown of the calculations this would work perfect.

Posted by Puybaret at Jan 22, 2013, 7:39:07 AM
Re: Area calculation and auto dimensions for 2D
The information you look for is included in Sweet Home 3D help:
- Editing dimensions
- Editing rooms
Please take the time to read it.
----------------------------------------
Emmanuel Puybaret, Sweet Home 3D creator

Posted by danielfranklinr at Mar 12, 2013, 4:10:57 AM
Re: Area calculation and auto dimensions for 2D
Hi Puybaret,

Sorry to revive this thread but it's about a similar subject.

I've been looking in the forum information about a plugin to automatically creates the dimensions lines to the walls (preferably the outside walls). I've read many times that it doesn't exist, but i don't know if it doesn't exist because it's complex or because it's not possible.

If it's possible i would like to give it a shot and create it for the community.

Posted by Puybaret at Mar 12, 2013, 9:27:32 AM
Re: Area calculation and auto dimensions for 2D
That sounds possible, but you'll have to make some choices about which dimensions to display and their offset. Have a look to getMeasuringDimensionLineAt method in PlanController class to help you start.
----------------------------------------
Emmanuel Puybaret, Sweet Home 3D creator

Posted by Fargo1 at Mar 12, 2013, 3:02:24 PM
Re: Area calculation and auto dimensions for 2D
Please post back if you get the plugin made

Posted by danielfranklinr at Mar 19, 2013, 3:30:28 AM
Re: Area calculation and auto dimensions for 2D
Sorry i took so long to post again. I don't have a lot of free time out of the office.

I created a first version of the plugin and posted it on sourceforge , but there are some things I have to modify. In short the Plugin does the following:

If you activate the button the first time it adds the dimension lines for every wall in the selected level.
If you activate the button for the second time it will delete all the dimension lines created in the first activation.

The points i'll be looking are the following:

1.- There has to be a way to calculate for each wall the correct offset. Some times the dimension line will be positioned inside the house.
2.- The function that Puybaret told is private so i had to extract it and encapsulate it in the plugin. The function needed the user preferences and the pixel length, but I couldn't manage to find a way to get them from the Plugin.
3.- I haven't found a way to separate the outer walls from the inner walls. Maybe creating an algorythm detecting the outermost points of the house could help detecting if a wall is inside those bounds or not, thus indicating the outer walls from the inner ones.

I hope you can try the plugin and give me some feedback, as soon as i get the bugs fixed I'll post again here.

Posted by hansmex at Mar 19, 2013, 5:22:00 AM
Re: Area calculation and auto dimensions for 2D
Daniel,

I gave your plug-in a quick test using two files.

Test dimensions is a file I made for testing your plug-in.
- Both levels get dimensions;
- Round walls get strange dimension(s), see bottom left;
- When using variable wall thickness the dimensions behave in a strange way. If I change all walls to the same thickness, the problem disappears.
- If you save a project with dimensions, after re-opening clicking the button doesn't erase the dimensions. They have to be erased manually.

Casa Paolo is a very simple house I designed a few days ago for a forum member. As you can see, your plug-in becomes confused:
- Level 0 dimensions aren't correct, even though all walls have the same thickness and the house is very simple;
- Level 1 dimensions don't appear at all.

Also, I noticed that all dimensions are taken from the centre line of walls. Normally, in the Netherlands, dimensions are taken along the inside and/or outside of walls, and wall thickness is dimensioned separately.

In larger designs, the number of dimensions can become quite large, thus making drawings hard to read. Not all dimensions are equally important, sometimes even irrelevant if for repeating wall segments.
Also, because individual wall sections are dimensioned, you won't have a dimension for the entire wall length.
Example: an outside wall is 10 metres long. On the inside are three rooms. You will see the room dimensions, but not the length of the entire wall.

A partial solution could be if:
a - you draw a large rectangle around your design, then select a number of walls. The dimensions of these walls are projected on the rectangle.
b - repeat if necessary.

Hans
----------------------------------------
Hans

new website - under constuction
hansdirkse.info

Posted by Puybaret at Mar 20, 2013, 4:33:51 PM
Re: Area calculation and auto dimensions for 2D
A nice start smile

The function that Puybaret told is private so i had to extract it and encapsulate it in the plugin
I pointed to you the getMeasuringDimensionLineAt method to give you hints. Nothing more and it's not a problem you copy it. You'll see that my development strategy is to generally keep many methods private. It's not that I don't want developers to call them, but exposing them as public would make them part of the API and oblige me to spend much more time to specify the best parameters.

The function needed the user preferences and the pixel length, but I couldn't manage to find a way to get them from the Plugin.
You can retrieve preferences with the Plugin#getUserPreferences method and pixel length with Plugin#getHomeController method. The later method returns a HomeController instance on which you can call getPlanController().getView().getPixelLength().

3.- I haven't found a way to separate the outer walls from the inner walls.
Look at RoomController class source code, the way walls surrounding a room are detected should help you. More generally, enumerating points with java.awt.geom.Area methods could be very helpful too.
----------------------------------------
Emmanuel Puybaret, Sweet Home 3D creator

Posted by Sajmmon at Mar 20, 2013, 8:18:44 PM
Re: Area calculation and auto dimensions for 2D
Nice plugin!

Posted by danielfranklinr at Mar 26, 2013, 9:34:49 PM
Re: Area calculation and auto dimensions for 2D
Thanks Sajmmon!.

I've been working on the bugs Hans mentioned, so i would like you guys to try it again. Click Here to download the plugin.

Here are the details i've corrected from Hans:
When using variable wall thickness the dimensions behave in a strange way. If I change all walls to the same thickness, the problem disappears.

Now it doesn't matter the thickness of the walls it will correctly display the dimension lines.


A partial solution could be if:
a - you draw a large rectangle around your design, then select a number of walls. The dimensions of these walls are projected on the rectangle.
b - repeat if necessary.

Thanks for this hint, it is simpler when the user just select the walls that wants to have the dimension.


Also, I noticed that all dimensions are taken from the centre line of walls. Normally, in the Netherlands, dimensions are taken along the inside and/or outside of walls, and wall thickness is dimensioned separately.


Thanks to the tip Puybaret told me i managed to find the roompaths and display the dimensions correctly. At this moment the plugin adds both dimensions, interior and exterior.


Hans, i tried to test your files, but for some reason it says i dont have a recent version of sweethome. I tried them with the desktop version and applet version, and it was the same error. Maybe you are working in a new release that we dont have.



Both levels get dimensions;

I tried many times to replicate this error creating multilevel plans and i couldn't do it. If you are in the first level and activate the plugin it will put the dimensions to the selected walls, if you change to level 2 and activate the plugin it will erase the dimensions in level 1 and add the dimensions in level 2.


Round walls get strange dimension(s), see bottom left;

Im using the same code that Puybaret does, the button to add dimensions lines doesn't work correctly in the original version either. I assume it's because the curve is just a lot of straight lines with angles to make the effect.



If you save a project with dimensions, after re-opening clicking the button doesn't erase the dimensions. They have to be erased manually.

Yes, i don't want the users deleting other dimensions lines by mistake, but maybe I'm wrong and that will feel natural. In fact I was thinking to add a second button in the plugin, one to add the lines, and another to delete them, that way the user can add as many dimensions as possible without deleting them.


I'm still working in two important this right now:
1.- Ask the user if the dimension lines should be the exterior or interior or both. This will make the plugin to exclude the longest dimension (interior dimensions) or exclude all the dimensions except the longest (exterior dimensions). This will not always work but i dont have other ideas. I'm open to suggestions here.
2.-To get the dimensions I am cycling the walls, getting the middle point, and trying to get the dimensions from the roompath. While doing this no every dimension is found. I was thinking that instead i should cycle the roompaths, and from there find the point of the wall that intersect to get the dimension. I hope that Puybaret gives me some light in this point.


Hope to hear some feedback from you soon.
Thanks

Posted by hansmex at Mar 26, 2013, 10:30:06 PM
Re: Area calculation and auto dimensions for 2D
Saniel,

Thank you for the new version of the plug-in. I tested it using the same two files that I attached to my previous post. By the way, those files were created using a beta version of SH3D v4.0. My tests today were done using the installed version 4.0.

I notice the following problems:

- Round walls don't get dimensioned.
- When dimensioning vertical walls, one dimension is "upside down". It should be rotated 180 degrees, so that the text is legible from the same point of view.
- Often dimensions are too close and one will be on top of another one.
- When a diagonal wall is touched by a horizontal wall (see left example in the Test dimensions file), and you want to add a dimension to the diagonal wall, the horizontal wall also gets a dimension.
- It is not possible to add dimensions on more than one level.

To overcome some problems, I think it would be useful to add a second button to delete dimensions, as you already suggested. That way you can selectively add or delete the dimensions of the highlighted walls.

Again I suggest a different approach to this plug-in. Imagine that you draw a large box around your design. Outside the box come the largest (or exterior) dimensions of the selected walls, inside the box come the smallest (or interior) dimensions of the selected walls. It should be possible to automatically calculate the size of that box.

Hans
----------------------------------------
Hans

new website - under constuction
hansdirkse.info