Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Con Promise
- let ifcObject = ... // un oggetto ritornato dal model
- ifcObject.promiseGetIsDefinedBy(relations => {
- relations = relations.filter(rel => rel.getType() === "IfcRelDefinesByType");
- return relations[0].promiseGetRelatingType();
- }).then(ifcObjectType => {
- console.log(ifcObjectType.getName());
- });
- // Senza Promise
- ifcObject.getIsDefinedBy(relation => {
- if (relation.getType() === "IfcRelDefinesByType") {
- relation.getRelatingType((ifcObjectType) => {
- console.log(ifcObjectType.getName());
- })
- }
- });
- // Poi poi commentare che "Già così il codice inizia ad essere più difficile da comprendere... e ci sono solamente due chiamate. Per arrivare da un elemento alle sue quantità ci sono minimo 4 chiamate consecuitive da fare, che devono essere tra loro sincronizzate!"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement