Adding custom properties to the model objects

This topic has been viewed 7362 times and has 3 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
javadch
Posts: 1
Joined: Mon Dec 29, 2014 12:05 am

Adding custom properties to the model objects

Post by javadch »

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.
okh
Posts: 1545
Joined: Sun May 12, 2013 9:43 pm

Re: Adding custom properties to the model objects

Post by okh »

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 [font=courier new]LIGHT_SOURCE[/font] and other properties, you can also add [font=courier new]PLAN_ICON [/font] to use electrical symbols for each item to change their display in the 2D view.

ok
User avatar
Puybaret
Posts: 9440
Joined: Mon Nov 07, 2005 12:00 pm
Country: Paris, France
Contact:

Re: Adding custom properties to the model objects

Post by Puybaret »

Okh, I don't think that javadch wants to imports models, but rather he wants to store additional data. [;)]

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 creator
okh
Posts: 1545
Joined: Sun May 12, 2013 9:43 pm

Re: Adding custom properties to the model objects

Post by okh »

Okh, I don't think that javadch wants to imports models, but rather he wants to store additional data. [;)]
Ah yes, commendable wish [:)]. 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
Post Reply New Topic

Who is online

Users browsing this forum: No registered users and 1 guest