opensourceBIM / BIMserver-JavaScript-API

BIMserver JavaScript API
GNU Lesser General Public License v3.0
55 stars 35 forks source link

Fix: model.getAllOfType correctly loads all subTypes #15

Closed GiacomoManzoli closed 5 years ago

GiacomoManzoli commented 6 years ago

In some cases the test

this.loadedTypes[type] != null

isn't enough, because loadedTypes is initialized with {} and then the call with includeAllSubTypes = true doesn't load all of the subtypes.

I've encountered this issue while calling getAllOfType("IfcProduct", true, function () { /* ...*/}) on the attached IFC file, using a Model object preloaded with the ifc2x3tc1 preload query.

quattromura_rev_2.ifc.zip

Also this pull request loads the objects in the proper loadedTypes dictionary.