Skip to content

Instantly share code, notes, and snippets.

View ibuilder's full-sized avatar

Matthew M. Emma ibuilder

View GitHub Profile
@ibuilder
ibuilder / building.xml
Created October 28, 2023 12:56
XSD file for Building
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="Building">
<xs:complexType>
<xs:sequence>
<xs:element name="Name" type="xs:string"/>
<xs:element name="Address" type="xs:string"/>
<xs:element name="FloorCount" type="xs:positiveInteger"/>
</xs:sequence>
</xs:complexType>
</xs:element>
@ibuilder
ibuilder / pyrevit_floorcreate.py
Created October 28, 2023 11:03
Create floor plan with pyrevit
# pip install pyrevit
import clr
clr.AddReference('RevitAPI')
import Autodeskfrom Autodesk.Revit.DB
import *import pyrevitfrom pyrevit
import revit
revit.doc = __revit__.ActiveUIDocument.Document
@ibuilder
ibuilder / dotbim_wall.py
Created October 20, 2023 10:28
Generate wall in dotbim using python
import dotbimpy as bim
# Create a new BIM modelmodel = bim.BIMModel()
# Add elements to the modelwall = bim.Wall()
wall.name = "Wall 1"wall.length = 5000wall.height = 3000# Add the wall to the modelmodel.add_element(wall)
# Save the model as a .bim filemodel.save("output.bim")
print("Model file generated successfully!")
@ibuilder
ibuilder / office_dynamo.py
Created October 19, 2023 18:34
Basic schema to generate an ifc model for office space using dynamo
# Import necessary libraries
# pip install dynamo-python
import dynamo
session = dynamo.Session()
# Define the number of employees and desired area per employee for each space
num_employees = {
'desks': 50,
'kitchen': 20,
@ibuilder
ibuilder / office_calc.py
Created October 19, 2023 18:29
Office Space Calculation
#Import necessary libraries
# Define the number of employees and desired area per employee for each space
num_employees = {
'desks': 50,
'kitchen': 20,
'bathrooms': 35,
'phone_booths': 10,
'mothers_room': 5,
'reception': 15,
@ibuilder
ibuilder / attom-api-call.py
Last active September 14, 2021 21:29
API call for Attom demographics Python
import http.client
import json
conn = http.client.HTTPSConnection("api.gateway.attomdata.com")
headers = {
'accept': "application/json",
'apikey': "xxx",
}
@ibuilder
ibuilder / game_rpsls.py
Created September 3, 2021 01:41
Rock Paper Scissor Lizard Spock
import random
class Characters():
def __init__(self, weight, player, winphrase, losephrase):
self.weight = weight
self.player = player
self.winphrase = winphrase
self.losephrase = losephrase
def __str__(self):
@ibuilder
ibuilder / nyc-deed-api.php
Last active February 4, 2020 14:57
NYC Open Data API for Deeds
<?php
$appkey = 'x3LTwBxAzd21ZTjtLeBI3C0JM';
$url='https://data.cityofnewyork.us/api/id/hzhn-3cmt.json?$limit=5000&$$app_token=$appkey';
$url = "https://data.cityofnewyork.us/api/id/hzhn-3cmt.json";
// Initialize a CURL session.
@ibuilder
ibuilder / procore-pull-data.php
Last active September 23, 2019 18:27
PHP class to pull data from @procore
<?php
class Procore_API{
private $client_id;
private $client_secret;
public function __construct() {
$general_settings = (array) get_option( 'procore_api_settings' );
$this->client_id = $general_settings["client_id"];
@ibuilder
ibuilder / server.sh
Last active March 11, 2017 16:58 — forked from seanmcn/gist:62a021a765ad4f8e593b
The Perfect Web Server - Nginx, Ajenti, Ubuntu
#!/bin/bash
if [ "$(id -u)" != "0" ]; then
echo "This script must be run as root" 1>&2
exit 1
fi
echo ':: Installing repo key'
wget http://repo.ajenti.org/debian/key -O- | apt-key add -
echo ':: Adding repo entry'