Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

COBieLiteUK: Conversion from IFC, IfcSystems ignored #19

Open
MichaelBuehler opened this issue Mar 1, 2017 · 1 comment
Open

COBieLiteUK: Conversion from IFC, IfcSystems ignored #19

MichaelBuehler opened this issue Mar 1, 2017 · 1 comment

Comments

@MichaelBuehler
Copy link

Hello,

Below code in Exchange > IfcToCOBieLiteUK > COBieLiteUKHelper.cs seems todo nothing: On Line 483, ret contains the correct list of systems, but ret is not used.

private void GetSystems()
    {
        _systemAssignment = new Dictionary<IIfcSystem, IItemSet<IIfcObjectDefinition>>();
        if (SystemMode.HasFlag(SystemExtractionMode.System))
        {
            var SystemAssignmentSet =
                    _model.Instances.OfType<IIfcRelAssignsToGroup>().Where(r => r.RelatingGroup is IIfcSystem)
                    .Distinct(new IfcRelAssignsToGroupRelatedGroupObjCompare()); //make sure we do not have duplicate keys, or ToDictionary will throw ex. could lose RelatedObjects though. 
            var ret = SystemAssignmentSet.ToDictionary(k => (IIfcSystem)k.RelatingGroup, v => v.RelatedObjects);
            _systemLookup = new Dictionary<IIfcObjectDefinition, List<IIfcSystem>>();
            ReportProgress.NextStage(SystemAssignment.Count, 35);
            foreach (var systemAssignment in SystemAssignment)
            {
                foreach (var objectDefinition in systemAssignment.Value)
                {
                    if (_systemLookup.ContainsKey(objectDefinition))
                        _systemLookup[objectDefinition].Add(systemAssignment.Key);
                    else
                        _systemLookup.Add(objectDefinition, new List<IIfcSystem>(new[] { systemAssignment.Key }));
                }
                ReportProgress.IncrementAndUpdate();
            }
        }

Consider to copy ret into SystemAssignment:
foreach(var item in ret)
_systemAssignment.Add(item.Key, item.Value);

@simiii
Copy link

simiii commented Feb 23, 2021

@MichaelBuehler how did you fix this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants