This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Universal header | |
import clr | |
clr.AddReference('ProtoGeometry') | |
from Autodesk.DesignScript.Geometry import * | |
clr.AddReference("RevitNodes") | |
import Revit | |
from Revit.Elements import * | |
clr.AddReference('RevitAPI') | |
import Autodesk | |
from Autodesk.Revit.DB import * |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Promise(fn) { | |
var state = 'pending'; | |
var value; | |
var deferred = null; | |
function resolve(newValue) { | |
if(newValue && typeof newValue.then === 'function') { | |
newValue.then(resolve); | |
return; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (false) { | |
new Promise((resCB) => { | |
console.log('First Promise'); | |
resCB('p1'); | |
}).then(res => { | |
console.log(`res = ${res}`); | |
}) | |
} else { | |
(async () => { | |
let res = await new Promise((resCB) => { |