diff --git a/.gitignore b/.gitignore index 45e6c0e..c071b8a 100644 --- a/.gitignore +++ b/.gitignore @@ -33,3 +33,4 @@ output/22_06_01/index.html output/22_07_01/index.html output/22_08_01/index.html output/22_09_01/index.html +__pycache__/HTMLBuild.cpython-39.pyc diff --git a/HTMLBuild.py b/HTMLBuild.py index 4e08486..9b03703 100644 --- a/HTMLBuild.py +++ b/HTMLBuild.py @@ -52,19 +52,22 @@ def writeHTML(model,name): cont+=2*"\t"+"\n" # ---- ADD HTMLBUILD JS - COULD ADD OTHERS HERE :) - # cont+=2*"\t"+"\n" + cont+=2*"\t"+"\n" + + # ---- JQUERY - IT WOULD BE CRAZY NOT TO + cont+=2*"\t"+"\n" # ---- CLOSE HEAD cont+=1*"\t"+"\n" # ---- ADD BODY - cont+=1*"\t"+"\n" + cont+=1*"\t"+"\n" # ---- ADD CUSTOM HTML FOR THE BUILDING HERE cont+=writeCustomHTML(model) # ---- CLOSE BODY AND HTML ENTITIES - cont+=1*"\t"+"\n" + cont+=1*"\t"+"\n" cont+=0*"\t"+"\n" # ---- WRITE IT OUT @@ -87,7 +90,7 @@ def writeCustomHTML(model): project = model.by_type('IfcProject')[0] custom+=2*"\t"+"\n".format(d=project.LongName) # it looks like it would make sense to use the DOM here and append stuff to it... - + # ---- ADD SITE CUSTOM ENTITY site = model.by_type('IfcSite')[0] site_elev = site.RefElevation diff --git a/batch.py b/batch.py new file mode 100644 index 0000000..ea7e35d --- /dev/null +++ b/batch.py @@ -0,0 +1,8 @@ +# Hi :) if just starting out - probably should start with the duplex.py this main.py references models that aren't shared on this repo + +import HTMLBuild as hb + +i=1 +while i < 10: + hb.modelLoader("22_{}_01".format(str(i).rjust(2, '0'))) + i+=1 diff --git a/main.py b/main.py index b24a3f0..327925b 100644 --- a/main.py +++ b/main.py @@ -2,4 +2,4 @@ import HTMLBuild as hb -hb.modelLoader("22_02_01") \ No newline at end of file +hb.modelLoader("22_05_01") \ No newline at end of file diff --git a/output/duplex/index.html b/output/duplex/index.html index f1997f0..5d3bdf6 100644 --- a/output/duplex/index.html +++ b/output/duplex/index.html @@ -1,8 +1,10 @@ + + - + diff --git a/output/js/html-build.js b/output/js/html-build.js index bae7afa..312f105 100644 --- a/output/js/html-build.js +++ b/output/js/html-build.js @@ -3,6 +3,22 @@ // we need to start (over)loading stuff into the DOM. // we need to split the screen into section and plan and KPIs and info - where should this go? + +function main() { + const floors = document.getElementsByTagName("floor-"); + let num_floors = floors.length; + console.log(num_floors); + $('project-').prepend('number of floors is '+num_floors); + $('project-').prepend('\nsite elevation is '+$('site-').attr('elev')); +} + + +/* +var container = document.getElementById('pcontainer'); +container.insertBefore(document.createElement("p"), container.firstChild); + +*/ + // - title etc.... | - also menu? site specific data? // --------------------------------------------------------------------- // - name of the building? this then needs to split in two... @@ -11,6 +27,6 @@ // #section | #plan // this shows the floors | this shows a floor in plan | // in section | #plan | -// ------------------------------------------ +// ----------------------------------------- // | | // --------------------------------------------------------------------- \ No newline at end of file