Get the list of Piece of Furniture that is displayed in the panel

This topic has been viewed 3745 times and has 2 replies
Thread status: Active
Questions about extending features and developing plug-ins [img]http://www.sweethome3d.com/images/flags/en_small.gif[/img]
Post Reply New Topic
Mitsaki
Posts: 62
Joined: Tue Jul 26, 2011 2:27 pm

Get the list of Piece of Furniture that is displayed in the panel

Post by Mitsaki »

Hello community,

I think I have a rather easy question. I have this code somewhere in my program

Code: Select all

for (HomePieceOfFurniture piece : home.getFurniture()) {
if (piece.isVisible()) {
i++;
}}
which I used in order to get the furniture that is visible in my room. The thing is that if some pieces are displayed twice, "i" doesn't count them, which is logical. How can I get the list of the furniture that are displayed in the panel which is placed in the bottom left corner in SH3D?

Thanks in advance guys:))
Mitsaki
User avatar
Puybaret
Posts: 9440
Joined: Mon Nov 07, 2005 12:00 pm
Country: Paris, France
Contact:

Re: Get the list of Piece of Furniture that is displayed in the panel

Post by Puybaret »

Each piece displayed in the home has a matching HomePieceOfFurniture instance even if it uses more than once a model in the catalog. Thus, your loop looks ok.
Emmanuel Puybaret, Sweet Home 3D creator
Mitsaki
Posts: 62
Joined: Tue Jul 26, 2011 2:27 pm

Re: Get the list of Piece of Furniture that is displayed in the panel

Post by Mitsaki »

Yeap, you are right:) I was under panic attack:)
Post Reply New Topic

Who is online

Users browsing this forum: No registered users and 1 guest