Add custom properties to Arch Space and Editing

A forum dedicated to the Draft, Arch and BIM workbenches development.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Post Reply
paullee
Veteran
Posts: 5098
Joined: Wed May 04, 2016 3:58 pm

Add custom properties to Arch Space and Editing

Post by paullee »

Hi, is it possible to add more custom properties to ArchSpace?

I am thinking if this could be a flexible tool to add construction information that are currently not available e.g. ceiling height, sockets no. and type, skirting type and size, sanitary fitments, luminaire type, air-conditioning temperature requirement, furniture requirements, etc. This might be useful to produce construction document.


Based on Chakkree's script on rebar https://forum.freecadweb.org/viewtopic. ... 98#p195314 and Yorik's help on Arch Spaces, I could gather basic information of all arch spaces on a spreadsheet by a simple script.

The spreadsheet only show ArchSpace information. I am conceiving if there is a kind of input tabulating all ArchSpace and properties, it would be much more convenient to input /copy data rather than inputting one by one at each Arch Space.


Screenshot from 2017-11-12 19-22-40.png
Screenshot from 2017-11-12 19-22-40.png (220.64 KiB) Viewed 2712 times
User avatar
regis
Posts: 725
Joined: Sun Jul 12, 2015 8:17 am
Contact:

Re: Add custom properties to Arch Space and Editing

Post by regis »

hahaha i've been thinking about the same thing concerning the Arch-Space, a bubble that contains all the internal information after the structure. I still have a few testing to do with the current arch space.
User avatar
yorik
Founder
Posts: 13640
Joined: Tue Feb 17, 2009 9:16 pm
Location: Brussels
Contact:

Re: Add custom properties to Arch Space and Editing

Post by yorik »

This is actually a complex question. You can (via python script) easily add new properties to any python-based feature (all Arch and Draft objects are python features):

Code: Select all

myobj = FreeCAD.ActiveDocument.ActiveObject
myobj.addProperty("App::PropertyString","MyCustomProperty")
myobj.MyCustomProperty = "Hello, World!")
This will be kept when you save the file, on reopening it your MyCustomProperty will be there. There are basically no limitations to this mechanism, you can add as many as you want.

But the whole concept of FreeCAD and parametric design, is to work with defined objects, with known properties. So instead of having users add all kinds of custom information, that another user or a program could hardly know about when reading the file, it is often more interesting to restrict ourselves to some maybe more strict structure, but that can be relied on (for example, a program can safely assume that the property will always be there).

So maybe it would be more interesting to do a little brainstorming here, and make a list of useful properties that could/should be added by default to all space objects. I personally would favor that solution, it will be useful to other users too.

Another solution, there is a property type in FreeCAD, the App::PropertyMap type, that can contain a python dictionary of string:string values, for example { "name":"yorik","occupation":"architect"}. We could add such a property to all Space objects. But then we kind of fall back on the first point...
paullee
Veteran
Posts: 5098
Joined: Wed May 04, 2016 3:58 pm

Re: Add custom properties to Arch Space and Editing

Post by paullee »

yorik wrote: Sun Nov 12, 2017 5:55 pm This is actually a complex question. You can (via python script) easily add new properties to any python-based feature (all Arch and Draft objects are python features):

Code: Select all

myobj = FreeCAD.ActiveDocument.ActiveObject
myobj.addProperty("App::PropertyString","MyCustomProperty")
myobj.MyCustomProperty = "Hello, World!")
This will be kept when you save the file, on reopening it your MyCustomProperty will be there. There are basically no limitations to this mechanism, you can add as many as you want.

But the whole concept of FreeCAD and parametric design, is to work with defined objects, with known properties. So instead of having users add all kinds of custom information, that another user or a program could hardly know about when reading the file, it is often more interesting to restrict ourselves to some maybe more strict structure, but that can be relied on (for example, a program can safely assume that the property will always be there).

So maybe it would be more interesting to do a little brainstorming here, and make a list of useful properties that could/should be added by default to all space objects. I personally would favor that solution, it will be useful to other users too.

Another solution, there is a property type in FreeCAD, the App::PropertyMap type, that can contain a python dictionary of string:string values, for example { "name":"yorik","occupation":"architect"}. We could add such a property to all Space objects. But then we kind of fall back on the first point...
Thanks for the information!

About the code, no need to have it on every computer to open the file right?
( I m reading Ikua's code about Atch Pipe which need to be present on every pc. Have read about Scripted Object but not tried, yet)

What to add? Lots to think indeed. Anything defined inIFC? Revit? Or possible FC to have a comprehensive list so other follow? Seem there is lot of different convention in different countries, impossible to unify on one hand, and may allow total flexibility on other.


First about objects that have already drawn, do not repeat input:-

- door / window for the room? (some code require calculating exit nos, width, glazing & opening area, etc.)
(need to manually add to Space, DAG problem...?)

- Multi-layer wall (slab) including finishes? (or Materials included finishes?)

- Arch Equipments? E.g for code / bill of quantities to count sanitary fitments , WC, basin, bath, water point etc.
… drain point

Objects that may be drawn in future, as Symbols ...

- bathroom acessories : soap dispenser, hand dryer, litter bin, towel ring/bar, curtain rail, paper dispensers,

- light switch, power socket, thermostat control, fuse spur...

- lighting point, lan point, telephone point, TV/Radio point,
- ... projector / pc connection point, microphone / AV,

- cctv, door phone, card access system, call alarm, public address, panic alarm...


Others?

- Ceiling tile layout/height - tile type & size
- Fire services - Sprinklers, detectors, hose reel ...
- HVAV, AC type, fresh air supply, return...
- sound / thermal insulation etc.
- hospital medical equipments, medical gas, calling point,


Yes, more people to brainstorm indeed :)
paullee
Veteran
Posts: 5098
Joined: Wed May 04, 2016 3:58 pm

Re: Add custom properties to Arch Space and Editing

Post by paullee »

p.s.

If somehow e.g door could be included / linked to Space, room, (any problem as currently no 2 groups for 1 object) , a schedule of all door object may be more meaningful as the room it/they are provided could be identified.

door 1 - Office1, office 20, office 30 - size, material …
door 2 - Store 1, store 5 - …
paullee
Veteran
Posts: 5098
Joined: Wed May 04, 2016 3:58 pm

Re: Add custom properties to Arch Space and Editing

Post by paullee »

regis wrote: Sun Nov 12, 2017 5:43 pm hahaha i've been thinking about the same thing concerning the Arch-Space, a bubble that contains all the internal information after the structure. I still have a few testing to do with the current arch space.
Hi. What is your idea?
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: Add custom properties to Arch Space and Editing

Post by Kunda1 »

Seems to overlap this thread: BOM (Bill Of Materials) function
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
paullee
Veteran
Posts: 5098
Joined: Wed May 04, 2016 3:58 pm

Re: Add custom properties to Arch Space and Editing

Post by paullee »

Kunda1 wrote: Tue Nov 14, 2017 7:52 am Seems to overlap this thread: BOM (Bill Of Materials) function
Hi, thanks. Noted and read through that thread.

That is to me the other end product, in building industry (British tradition?) for a Quantity Surveyor to prepare a Bill of Quantity.

I am just thinking currently to start with -

1. how to input information, that might need or not be modeled or not, or at least no need to model in every single room, e.g. skirting, lan point, light switch - currently i do not know where to input (or just just spreadsheet programe?).

2. present or organise them in a particular sensible way, for checking, review, change - knowing there are a total of 30 wIndows are BQ thing. I may want to check by listing out window against room area and auto calculate the ratio.

Thanks for sharIng idea.
paullee
Veteran
Posts: 5098
Joined: Wed May 04, 2016 3:58 pm

Re: Add custom properties to Arch Space and Editing

Post by paullee »

It turn out inclusion of windows is quite 'built-in' in FC

First attempt, window label and area in spreadsheet:-


Screenshot from 2017-11-15 20-46-00.png
Screenshot from 2017-11-15 20-46-00.png (244.17 KiB) Viewed 2519 times
Post Reply