|
Sweet Home 3D Forum » List all forums » » Forum: Developers » » » Thread: Room size in java code |
||
| Print at Dec 20, 2025, 6:17:26 AM |
|
|
| Posted by anandunadkat at Jan 16, 2013, 10:38:57 AM |
|
Room size in java code Hi, I am a beginner in this area and this is my first plugin. I am trying to develop a plugin to allow users to enter a bathroom template. There is a function where they have to enter the room size or choose automatically. how do i add size of lets say 2400mm x 2500mm into java code. Also how do i position objects into a certain area? I really appreciate your help! please help me :( |
| Posted by Sajmmon at Jan 16, 2013, 12:55:46 PM |
|
Re: Room size in java code Adding rooms is quite simple, try: public class SimpleAction extends PluginAction{ |
| Posted by Sajmmon at Jan 16, 2013, 2:10:45 PM |
|
Re: Room size in java code If your models are already imported try: |
| Posted by Sajmmon at Jan 16, 2013, 2:27:21 PM |
|
Re: Room size in java code and last step is adding your hpof to home: home.addPieceOfFurniture(hpof); |
| Posted by anandunadkat at Jan 16, 2013, 3:15:27 PM |
|
Re: Room size in java code Hi, Thank you so much for you help. The code looks good. I understand how to get object from current library using category and number in that category. What i don't understand is how do i size my house/room to lets say 2700mm x 2500mm. And also how to I add new piece of furniture/furnitures in the current library. Do i have to add the object to Eclipse project? if so how can i do that? Thanks you so much i really appreciate it |
| Posted by Sajmmon at Jan 16, 2013, 10:44:39 PM |
|
Re: Room size in java code Home refers in SweetHome to an open project. Walls are walls. Room refers to a polygon drawn on ground/level (and the ceiling is associated with the polygon as well). You can also create a room just by drawing walls - without floor (our Room). It might be misleading, but I am sure that after playing a bit with user interface you will understand the underlying Java classes. Good luck. |
| Posted by anandunadkat at Jan 17, 2013, 10:18:51 AM |
|
Re: Room size in java code To make things easier to understand, i have pasted my code. if (validateHouse()){ // if both house and bedroom dimension are unknown then speciry the hardcoded values. if (cbUnknownHouseDimension.isSelected()){ bathroomLength = 1000f; bathroomBreadth = 600f; //bedroomLength = 250f; //bedroomBreadth = 200f; } So as you can see from the code, if the user doesnt know the measurements, it clicks on the checkbox and i want the house size to appear with default values. Hope you understand what i mean. Many thanks for your help!! |
| Posted by Sajmmon at Jan 17, 2013, 9:12:46 PM |
|
Re: Room size in java code The code below: results in: ![]() It would be great to hear more about your case study! Cheers |
| Posted by anandunadkat at Jan 18, 2013, 9:31:17 AM |
Re: Room size in java codeThank you so much for you help. I really do appreciate it. I will just paste a screenshot so you know what i am trying to get here. User clicks on the option ![]() WIndow will pop up asking for measurements And then a template will come up. ![]() as you can see from the screenshot, that it allows you to add railings as well. I have created a new object but it will not show up. below is code for one of them. public static void addRightAngleRail(Home home,code for adding a room according to the measurements is here public class ExecuteCommand {So now i want to add a new furniture library so users can access those furniture without importing. And i want to arrange those object properly as you can see that they are not. Please help!!! |
| Posted by Sajmmon at Jan 18, 2013, 12:13:36 PM |
|
Re: Room size in java code It is very interesting what you are doing. I dont know a simple answer to your question right now. I will think about it. |
|
|
|
Current timezone is GMT Dec 20, 2025, 6:17:26 AM |