New Arch Schedule tool

Info about new community or project announcements, implemented features, classes, modules or APIs. Might get technical!
PLEASE DO NOT POST HELP REQUESTS OR OTHER DISCUSSIONS HERE!
User avatar
yorik
Site Admin
Posts: 10725
Joined: Tue Feb 17, 2009 9:16 pm
Location: São Paulo, Brazil
Contact:

New Arch Schedule tool

Postby yorik » Tue Aug 30, 2016 2:32 pm

With git commit 0d25df0 the Arch Schedule tool has been completely rewritten. It is now much simpler, flexible and can be useful to many more situations, not only Arch. Basically, it is a generic tool to gather data from the model and put it in a spreadsheet. It works like this:

First you need to have a model. For example, here is a document with a couple of objects. I did Arch stuff here, but it doesn't need to be Arch, it can be anything.
Arch_schedule_example01.jpg
Arch_schedule_example01.jpg (134.33 KiB) Viewed 3455 times
Then you press the Arch Schedule button. You get a task panel like this. It is pretty wide, so you'll need to widen the task panel to be comfortable.
Arch_schedule_example02.jpg
Arch_schedule_example02.jpg (53.78 KiB) Viewed 3455 times
Then you can fill line by line. Each line is a "query" and will render one line in the spreadsheet. Press the Add button to add a new line, and double-click each cell from that lien to fill in the values. Values are:
  • Description: A description for this query. The Description column will be the first column of the resulting spreadsheet. The description is mandatory to have a query performed. If you leave the description cell empty, the whole line will be skipped and left blank in the spreadsheet. This allows you to add "separator" lines.
  • Value: This is the real query that you want to perform on all the objects selected by this query. It can be two kinds of things: either the word count (or Count or COUNT, it's case-insensitive), which will simply count objects, or retrieve ans sum a property, for example object.Shape.Volume or object.Length or even object.Label. The name you use before the first dot (object) can be anything, you could also write x.Shape.Volume. The rule is: what comes after the first dot will be retrieved from each object selected by this query, if possible (object that don't have the required property will be skipped), and the result will be added together. For example, if you use object.Shape.Volume, you will get the sum of all volumes of all objects selected by this query.
  • Unit: An optional unit to express the results in. It's up to you to give a unit that matches the query you are doing, for example, if you are retrieving volumes, you should use a volume unit, such as m^3. If you use a wrong unit, for ex. cm, you'll get wrong results.
  • Objects: You can leave this empty, then all the objects of the document will be considered by this query, or give a semicolon (;)-separated list of object names (not labels). If any of the objects in this list is a group, its children will be selected as well. So the easiest way to use this feature is to group your objects meaningfully in the document, and just give a group name here. You can also use the Selection button to add objects currently selected in the document.
  • Filter: Here you can add a semicolon(;)-separated list of filters. Each filter is written in the form: filter:value, where filter can be (it's case-insensitive too): Name, Label, Type, Role, or !Name, !Label, !Type, !Role. Fro example: name:door;type:window will filter the objects we got from the step above, and retain only those whose name contains "door" AND the type (returned by Draft.getType) is "wall". Everything is case-insensitive. Filters that begins with ! are inverted. For example, !name:wall will retain only objects that DON'T have "wall" in their name. "Role" is a property that all Arch objects have.
The Import button allows you to build this list in another spreadsheet application, and import that as a csv file here.

So we can build a list of queries like this:
Arch_schedule_example03.jpg
Arch_schedule_example03.jpg (73.59 KiB) Viewed 3455 times
After that, press OK and a new Schedule object is added to the document, which contains a result spreadsheet:
Arch_schedule_example04.jpg
Arch_schedule_example04.jpg (75.23 KiB) Viewed 3455 times
By double-clicking the Schedule object, you get back to the task panel and change the values. By double-clicking the spreadsheet itself, you get the results in 3 columns: description, value, unit (if applicable):
Arch_schedule_example05.jpg
Arch_schedule_example05.jpg (74.67 KiB) Viewed 3455 times
The spreadsheet can then be exported to csv normally, from the Spreadsheet workbench.

That's more or less it. No more fiddling with prices, no more complex stuff, all that you would now do in a better spreadsheet app, outside of FreeCAD. The idea here is that you can "drop-in and drop-out" pieces of spreadsheets between FreeCAD and another spreadsheet. For example, you build a price list in LibreOffice. You reserve 5 columns at the end of your prices list that will be exported to csv and contain just the things we need here above. Then, you import back the result from FreeCAD into your "quantities" column, and bingo, your price list is done :)

Of course there is much room for improvement. The filters list is somewhat limited to Arch stuff, and could be widened a lot, the objects selection system is not 100% good yet, one could think of auto-syncing with libreoffice, etc. But I think now this tool is on the right track, it can basically get "anything" from the document.
Attachments
house.fcstd
(46.02 KiB) Downloaded 69 times
User avatar
yorik
Site Admin
Posts: 10725
Joined: Tue Feb 17, 2009 9:16 pm
Location: São Paulo, Brazil
Contact:

Re: New Arch Schedule tool

Postby yorik » Tue Aug 30, 2016 3:35 pm

One last thing I forgot to add: the report view shows the detail of what is computed, so you can check.
Renato Rebelo
Posts: 217
Joined: Mon May 19, 2014 1:14 pm
Location: Vouzela - Portugal

Re: New Arch Schedule tool

Postby Renato Rebelo » Tue Aug 30, 2016 10:31 pm

Hello,
You have been very busy ...
but I think it has been worth it,
I have only one suggestion. it is possible to list all the objects? or all objects of a kind?
thank you,
Renato
my native language is not English, please excuse me any incorrectness, I apologize for any inconvenience caused, thank you
User avatar
yorik
Site Admin
Posts: 10725
Joined: Tue Feb 17, 2009 9:16 pm
Location: São Paulo, Brazil
Contact:

Re: New Arch Schedule tool

Postby yorik » Wed Aug 31, 2016 12:07 am

Renato Rebelo wrote:I have only one suggestion. it is possible to list all the objects? or all objects of a kind?
Yes, saso and I have been chatting about that... What would be useful is to be able to print somehting like this:

window001 height: 120cm width: 80cm
window002 height: 210cm width: 140cm

Not sure how to do that yet, I must think a bit more, but yeah, we absolutely need this :)
Jee-Bee
Posts: 1618
Joined: Tue Jun 16, 2015 10:32 am
Location: Netherlands

Re: New Arch Schedule tool

Postby Jee-Bee » Wed Aug 31, 2016 8:37 am

yorik wrote:What would be useful is to be able to print somehting like this:

window001 height: 120cm width: 80cm
window002 height: 210cm width: 140cm

Not sure how to do that yet, I must think a bit more, but yeah, we absolutely need this :)
i think a feature like this is FreeCAD over-all a nice feature also for the future Assemebly branch.
triplus
Posts: 8154
Joined: Mon Dec 12, 2011 4:45 pm

Re: New Arch Schedule tool

Postby triplus » Wed Aug 31, 2016 11:20 am

I like it but Tasks sidebar isn't suitable for such thing. I don't like excessive pop-up windows all that much but for your use case it is more appropriate compared to adding it to Tasks sidebar.

Another options is to open spreadsheet directly or to have vertically aligned input fields in Tasks sidebar for just one row at a time.
Renato Rebelo
Posts: 217
Joined: Mon May 19, 2014 1:14 pm
Location: Vouzela - Portugal

Re: New Arch Schedule tool

Postby Renato Rebelo » Wed Aug 31, 2016 9:27 pm

yorik wrote:
Yes, saso and I have been chatting about that... What would be useful is to be able to print somehting like this:

window001 height: 120cm width: 80cm
window002 height: 210cm width: 140cm

Not sure how to do that yet, I must think a bit more, but yeah, we absolutely need this :)
Yes, that's it.
very useful to "openings maps" (do not know the correct expression in English?)
thank you,
Renato
my native language is not English, please excuse me any incorrectness, I apologize for any inconvenience caused, thank you
User avatar
saso
Posts: 1135
Joined: Fri May 16, 2014 1:14 pm
Contact:

Re: New Arch Schedule tool

Postby saso » Sat Sep 03, 2016 2:08 am

Is this working for others? On Win10 x64, every time I click Ok in the Schedule definition Task window, the created spreadsheet gets in to a funny state where all the text in the spreadsheet disappears, but if I click on a cell I can see the text is still there? :|

OS: Windows 10
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.17.8353 (Git)
Build type: Release
Branch: master
Hash: 04aa24ec00bcd05442b1b345757175a4459fc553
Python version: 2.7.8
Qt version: 4.8.7
Coin version: 4.0.0a
OCC version: 7.0.0
User avatar
yorik
Site Admin
Posts: 10725
Joined: Tue Feb 17, 2009 9:16 pm
Location: São Paulo, Brazil
Contact:

Re: New Arch Schedule tool

Postby yorik » Sat Sep 03, 2016 3:57 pm

saso wrote:the created spreadsheet gets in to a funny state where all the text in the spreadsheet disappears, but if I click on a cell I can see the text is still there
Yes I have seen that a couple of times as well. But in all cases if I saved the file and reopened it, the spreadsheet displays OK. This is apparently a bug in the spreadsheet itself, but I couldn't isolate it enough to have a clue at what might be wrong...