sad How to access new 3D model from code

This topic has been viewed 3568 times and has 1 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
josleen
Posts: 10
Joined: Sun Feb 27, 2011 4:11 pm
Country: Luton, Bedfordshire, 222

How to access new 3D model from code

Post by josleen »

Hi,

I create a 3D model and imported it via the furniture import in the Miscellaneous category. I tried to access the model using catalog.getCategory(6).getPieceOfFurniture(5) in HomePieceOfFurniture. But it would only show the default models no matter what. It is logical since the catalog contains only the default models. Now, how can I access my new model using the code? I am developing a plugin so I dont want to change the source code? Suggest Please !!!
User avatar
Puybaret
Posts: 9440
Joined: Mon Nov 07, 2005 12:00 pm
Country: Paris, France
Contact:

Re: How to access new 3D model from code

Post by Puybaret »

To get the last piece of furniture added to the catalog, I would add a CollectionListener to the catalog instance returned by getUserPreferences().getFurnitureCatalog().
Emmanuel Puybaret, Sweet Home 3D creator
Post Reply New Topic

Who is online

Users browsing this forum: No registered users and 1 guest