-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' of https://github.com/3BMLabs/building.py
- Loading branch information
Showing
586 changed files
with
2,917,940 additions
and
8 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
from objects.frame import * | ||
from exchange.struct4U import * | ||
|
||
|
||
filepath = "C:/Users/mikev/3BM/3BM - 3BM Sharepoint/50_projecten/3_3BM_bouwtechniek/2321 Plan WHSD-locatie Oude-Tonge/71_constructie_advies/2321-5.3 Constructie bedrijfshal V3.xml" | ||
|
||
tree = ET.parse(filepath) | ||
root = tree.getroot() | ||
|
||
#convert .xml to buildingpy objects. | ||
obj = [] | ||
|
||
#LoadGrid and create in Speckle | ||
XYZ = XMLImportNodes(tree) | ||
|
||
obj = obj + XMLImportGrids(tree, 1000) | ||
obj.append(XMLImportPlates(tree)) | ||
|
||
|
||
#BEAMS | ||
BeamsFrom = root.findall(".//Beams/From_node_number") | ||
BeamsNumber = root.findall(".//Beams/Number") | ||
BeamsTo = root.findall(".//Beams/To_node_number") | ||
BeamsName = root.findall(".//Beams/Profile_number") | ||
BeamsLayer = root.findall(".//Beams/Layer") | ||
BeamsRotation = root.findall(".//Beams/Angle") | ||
|
||
#PROFILES | ||
ProfileNumber = root.findall(".//Profiles/Number") | ||
ProfileName = root.findall(".//Profiles/Profile_name") | ||
|
||
#BEAMS | ||
for i, j, k, l, m in zip(BeamsFrom, BeamsTo, BeamsName, BeamsNumber, BeamsRotation): | ||
profile_name = ProfileName[int(k.text)-1].text | ||
profile_name = profile_name.split()[0] | ||
if profile_name == None: | ||
print(f"No profile name '{profile_name}' found.") | ||
else: | ||
start = XYZ[1][XYZ[0].index(i.text)] | ||
end = XYZ[1][XYZ[0].index(j.text)] | ||
try: | ||
pf = Frame.by_startpoint_endpoint_profile_shapevector(start, end, profile_name, profile_name + "-" + l.text, Vector2(0,0), float(m.text), BaseSteel, None) | ||
if pf != None: | ||
obj.append(pf) | ||
except Exception as e: | ||
print(f"Could not translate '{profile_name}'.") | ||
print(f"Generated BuildingPy Objects.") | ||
|
||
print(obj) |
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
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
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
33 changes: 33 additions & 0 deletions
33
sandbox/Versie juni 2024/.github/workflows/generate-bp_single_file.yml
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
name: Generate bp_single_file | ||
|
||
on: | ||
schedule: | ||
- cron: '0 0 * * *' | ||
|
||
jobs: | ||
run_python_script: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Set up Python 3.10 | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: '3.10' | ||
|
||
- name: Execute Python script | ||
run: | | ||
python docs/write_bp_single_file.py | ||
- name: Commit and push if changes | ||
run: | | ||
git config --local user.email "action@github.com" | ||
git config --local user.name "GitHub Action" | ||
git status | ||
git add bp_single_file.py | ||
git commit -m "Automatically updated bp_single_file.py" || true | ||
git push |
40 changes: 40 additions & 0 deletions
40
sandbox/Versie juni 2024/.github/workflows/python-publish.yml
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
name: Upload Python Package | ||
|
||
on: | ||
release: | ||
types: [published] | ||
workflow_dispatch: | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
deploy: | ||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
matrix: | ||
python-version: ['3.10', '3.11', '3.12'] | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
path: 'pypi' | ||
- name: Set up Python | ||
uses: actions/setup-python@v3 | ||
with: | ||
python-version: '${{ matrix.python-version }}' | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install build | ||
- name: Build package | ||
run: | | ||
cd pypi | ||
python -m build | ||
- name: Publish package | ||
if: matrix.python-version == '3.12' | ||
uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29 | ||
with: | ||
user: __token__ | ||
password: ${{ secrets.PYPI_API_TOKEN }} |
35 changes: 35 additions & 0 deletions
35
sandbox/Versie juni 2024/.github/workflows/update_wiki.yml
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
name: Update Wiki | ||
|
||
on: | ||
schedule: | ||
- cron: '0 0 * * *' | ||
|
||
jobs: | ||
update_wiki: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Clone Wiki Repository | ||
run: | | ||
git clone https://github.com/3BMLabs/building.py.wiki.git wiki | ||
- name: Copy Documentation to Wiki | ||
run: | | ||
cp docs/usage/*.md wiki/ | ||
- name: Commit and Push Changes to Wiki | ||
env: | ||
MY_WIKI_PAT: ${{ secrets.MY_WIKI_PAT }} | ||
run: | | ||
cd wiki | ||
git add . | ||
git config --local user.email "action@github.com" | ||
git config --local user.name "GitHub Action" | ||
git commit -m "Update wiki documentation" || true | ||
git push --set-upstream https://${{ env.MY_WIKI_PAT }}@github.com/3BMLabs/building.py.wiki.git | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
*.pyc | ||
*.iml | ||
*.xml | ||
*.xml | ||
.idea | ||
\prive |
Oops, something went wrong.