Print at Feb 21, 2020, 2:20:58 AM View all posts in this thread on one page
Posted by javadch at Dec 29, 2014, 12:15:22 AM
Adding custom properties to the model objects
I am developing a pligin (as well as a model of electrical objects) that uses the lamps and other electrical model objects to calculate the wiring requirements. for this purpose I need to add some extra attributes like power consumption, generated heat, complying standard and so on. or to add the max ampere to a wall mount plug.
How is it possible to edit the current furniture items? and also how can I use other free tools to construct such model objects.
A concrete instruction would be highly appreciated.

Posted by okh at Dec 30, 2014, 12:21:21 PM
Re: Adding custom properties to the model objects
To create your own models, see alternatives on the 3D models page Blender, Art of Illusion, Sketchup etc. are all good (but very different) alternatives. In addition, you could look at editing advanced properties for your models. See the DefaultFurnitureCatalog.Properties (and there is a short intro on how p. 9 of the SVG/properties guide).

If you create your own models, note that in addition to LIGHT_SOURCE and other properties, you can also add PLAN_ICON to use electrical symbols for each item to change their display in the 2D view.

ok

Posted by Puybaret at Dec 30, 2014, 3:12:00 PM
Re: Adding custom properties to the model objects
Okh, I don't think that javadch wants to imports models, but rather he wants to store additional data. wink

javadch, you could store your data in the description property of a piece of furniture which is not displayed in the user interface at the moment. Or if you want to organize your data differently, you could use setVisualProperty / getVisualProperty methods in Home class to store and retrieve a map with furniture as key and some serializable data as value.
If you want something better, you'll have to to create a derived version of Sweet Home 3D something more complicate than programming a plug-in, but then you'll have the choice through customized controllers to override what you want.

See also this thread
----------------------------------------
Emmanuel Puybaret, Sweet Home 3D developer

Posted by okh at Dec 31, 2014, 12:15:15 PM
Re: Adding custom properties to the model objects
Okh, I don't think that javadch wants to imports models, but rather he wants to store additional data. wink
Ah yes, commendable wish smile. Sorry if I confused things. Just a question of wishful thinking on my part, I guess. Sat with an electrician yesterday to calculate electric requirements, wire-diameters, voltage-drop and fuses for a 12V solar system (I did make models of standard batteries and solar panels for the project). Would be interesting to see any related work. ok