BCF Support GSoC Proposal

Contributions from the participants, questions and answers to their projects.
Discussions of proposals for upcoming events.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
User avatar
yorik
Founder
Posts: 13640
Joined: Tue Feb 17, 2009 9:16 pm
Location: Brussels
Contact:

Re: BCF Support GSoC Proposal

Post by yorik »

Great! Have fun!
User avatar
pPodest
Posts: 71
Joined: Sat Feb 16, 2019 3:18 pm

Re: BCF Support GSoC Proposal

Post by pPodest »

Hi, I wanted to give an update of the last few days here in the forum, and also ask a question about how something is done in FreeCAD, especially in the BIM workbench.

So first steps first. Update: The PI (programmatic interface) is now mostly finished in its basic functionality, and can be used as normal CLI application, to inspect and modify contents of a bcf file, as well as in FreeCAD in both Gui and nonGui mode. However, no Gui is launched on import into FreeCAD, in Gui mode the python console is still the only interface through which the plugin can be controlled. However, if launched in Gui mode, the camera of the active view can be set according to a certain viewpoint, specified in the BCF file.

The question I have is, in fact, related to viewpoints: A viewpoint information file (viewpoint.bcfv) may specify some components that shall be highlighted/selected/colored. Components are thereby referenced through their IFC Guid, which is an alphanumeric string including '$' and '_' of length 22. Over the last week, I made some attempts to find a member of an object (in FreeCAD) that contains the IFC Guid. The only lead I have the object BuildingPart with its member IfcAttributes. I then also noticed the FreeCAD command (of the BIM workbench) Manage->Manage IFC Properties. But it, and its relatives Manage IFC quantities and Manage IFC elements are constantly greyed out. The problem here is probably that I don't know the proper workflow for generating models that have IFC properties and thus don't get to the point where these commands can be used. Do you have a solution regarding this?
Because I want to use the Manage IFC properties command to get a lead how to programmatically inspect the objects of a document, and search for a particular component based on its IFC Guid. That is the main problem I am facing.

Thanks for already reading that far into my post!
User avatar
yorik
Founder
Posts: 13640
Joined: Tue Feb 17, 2009 9:16 pm
Location: Brussels
Contact:

Re: BCF Support GSoC Proposal

Post by yorik »

Code: Select all

def getIfcUID(obj):
    if hasattr(obj,"IfcData"):
        if "IfcUID" in obj.IfcData:
            return obj.IfcData["IfcUID"]
    return None
In recent versions of FreeCAD IfcAttributes has been renamed to IfcData (because there exists such things as IFC attributes, so our internal dict was better with another name)

It basically works like this: Only Arch objects can have an IFC UID (they don't always have one). When importing from an IFC file, all IFC GUIDs are retrieved. When saving a FreeCAD model to IFC, all generated IFC GUIDS are also saved back in the FreeCAD document. So the best way to automatically add an IFC GUID to all the Arch objects in your document, is simply to export it to IFC.

The IfcData property also contains dynamic attributes that are added/removed when you change the IFC type (all managed in ArchIFC.py)

The IFC properties are stored in the IfcProperties property, under one of these two forms:

"propertyname" : "propertyset;;propertytype;;propertyvalue"

or (in FreeCAD0.19, so you can have different properties with same name in different psets):

"propertyname;;propertyset" : "propertytype;;propertyvalue"

The properties manager is greyed out if you are using FreeCAD 0.18, because there was incomplete support for it...
User avatar
pPodest
Posts: 71
Joined: Sat Feb 16, 2019 3:18 pm

Re: BCF Support GSoC Proposal

Post by pPodest »

Thank you very much for that explanation! Especially the last sentence cleared out the confusion in my head.
I will test it with 0.19 right away.
User avatar
yorik
Founder
Posts: 13640
Joined: Tue Feb 17, 2009 9:16 pm
Location: Brussels
Contact:

Re: BCF Support GSoC Proposal

Post by yorik »

I should actually add something to inform the user why these buttons are greyed out...
User avatar
yorik
Founder
Posts: 13640
Joined: Tue Feb 17, 2009 9:16 pm
Location: Brussels
Contact:

Re: BCF Support GSoC Proposal

Post by yorik »

Just looked at your code and UI tests, all going in the right direction I think. Keep up the good work!
User avatar
hardeeprai
Posts: 177
Joined: Sun May 23, 2010 2:41 pm
Location: Ludhiana, Punjab, India
Contact:

Re: BCF Support GSoC Proposal

Post by hardeeprai »

yorik wrote: Tue Jul 09, 2019 6:41 pm Just looked at your code and UI tests, all going in the right direction I think. Keep up the good work!
+1

@ pPodest

Though you are updating your DevLog daily at https://podestplatz.github.io/FreeCAD-b ... /dev-logs/ , but posting here alternate day or twice a week is desirable.
--
H.S.Rai
User avatar
yorik
Founder
Posts: 13640
Joined: Tue Feb 17, 2009 9:16 pm
Location: Brussels
Contact:

Re: BCF Support GSoC Proposal

Post by yorik »

hardeeprai wrote: Wed Jul 10, 2019 11:24 pm Though you are updating your DevLog daily at https://podestplatz.github.io/FreeCAD-b ... /dev-logs/ , but posting here alternate day or twice a week is desirable.
Yes please, some update here would be welcome! ;)
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: BCF Support GSoC Proposal

Post by Kunda1 »

hardeeprai wrote: Wed Jul 10, 2019 11:24 pm Though you are updating your DevLog daily at https://podestplatz.github.io/FreeCAD-b ... /dev-logs/ , but posting here alternate day or twice a week is desirable.
:+1: here as well
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
User avatar
pPodest
Posts: 71
Joined: Sat Feb 16, 2019 3:18 pm

Re: BCF Support GSoC Proposal

Post by pPodest »

Hi!

I am sorry for the long radio silence on my side in the forum. I have to admit that I already wanted to post an update to the forum, with the current state of development, in a more compiled version than on the dev log.

I will write a post later today, since now I can actually already show stuff.

In my opinion, I find it hard to schedule time for writing a post when development is going good, because then I think “I will still implement this feature and then write the post”, which then does not happen.
Post Reply