Skip to content

Commit

Permalink
Merge pull request #2 from rpakishore/Dev20240207
Browse files Browse the repository at this point in the history
- Expanded Usage and Documentation
- Changed License from MIT to MPL
- `Points`, `Frames`, `Results`, `Material` & `Rebar` Subclasses added
- Added Option to Export to `.pe` files
  • Loading branch information
rpakishore authored Feb 22, 2024
2 parents 528b7e1 + 5db36a0 commit 056490e
Show file tree
Hide file tree
Showing 41 changed files with 1,313 additions and 190 deletions.
8 changes: 5 additions & 3 deletions .streamlit/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ runOnSave = true
gatherUsageStats = false

[theme]

# The preset Streamlit theme that your custom theme inherits from. One of "light" or "dark".
base = "light"
base="light"
primaryColor="#3ec32e"
secondaryBackgroundColor="#d5dcdc"
textColor="#000000"
font="serif"
394 changes: 373 additions & 21 deletions LICENSE

Large diffs are not rendered by default.

55 changes: 41 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,18 @@
<div align="center">
<h1>ak_sap</h1>
<p>
Python wrapper for SAP2000
Python wrapper for SAP2000.
Generate/Analyze/Extract complex structural models using python.
</p>
<h4>
<a href="https://github.com/rpakishore/ak_sap/">View Demo</a>
<a href="https://github.com/rpakishore/ak_sap/blob/main/documentation/Usage/GUI.md">GUI</a>
<span> · </span>
<a href="https://github.com/rpakishore/ak_sap">Documentation</a>
<a href="https://github.com/rpakishore/ak_sap/tree/main?tab=readme-ov-file#2-getting-started">Getting Started</a>
<span> · </span>
<a href="https://github.com/rpakishore/ak_sap/issues/">Report Bug</a>
<a href="https://github.com/rpakishore/ak_sap/blob/main/documentation/Layout.md">Layout Documentation</a>
<span> · </span>
<a href="https://github.com/rpakishore/ak_sap/issues/">Request Feature</a>
<a href="https://github.com/rpakishore/ak_sap/issues/">Report Bug/Request Feature</a>

</h4>
</div>
<br />
Expand All @@ -28,11 +30,13 @@
- [2.1. Prerequisites](#21-prerequisites)
- [2.2. Installation](#22-installation)
- [2.2.1. Production](#221-production)
- [2.2.1.1. Install directly from repo](#2211-install-directly-from-repo)
- [2.2.1.2. Install from Pypi release](#2212-install-from-pypi-release)
- [2.2.1.1. One line command](#2211-one-line-command)
- [2.2.1.2. Install directly from repo](#2212-install-directly-from-repo)
- [2.2.1.3. Install from Pypi release](#2213-install-from-pypi-release)
- [2.2.2. Development](#222-development)
- [3. Usage](#3-usage)
- [3.1. GUI](#31-gui)
- [3.2. Layout Documentation](#32-layout-documentation)
- [4. Roadmap](#4-roadmap)
- [5. License](#5-license)
- [6. Contact](#6-contact)
Expand All @@ -55,28 +59,47 @@

#### 2.2.1. Production

##### 2.2.1.1. Install directly from repo
##### 2.2.1.1. One line command

1. Press `Win` + `R` to open the Run console
2. Type "powershell" and press enter
3. change directory to the desired install folder using the cd command.

Example:

```powershell
cd "C:\Users\test-user\Desktop\Temp"
```

4. Type the following and press `Enter`

```powershell
irm https://links.struct.work/SAP2000 | iex
```

##### 2.2.1.2. Install directly from repo

Clone repo and Install with flit

```bash
git clone git@github.com:rpakishore/ak_sap.git
git clone https://github.com/rpakishore/ak_sap.git
cd ak_sap
pip install flit
flit install --deps production
```

##### 2.2.1.2. Install from Pypi release
##### 2.2.1.3. Install from Pypi release

```bash
pip install ak_sap
```

#### 2.2.2. Development

Download the git and install via flit

```bash
git clone git@github.com:rpakishore/ak_sap.git
git clone https://github.com/rpakishore/ak_sap.git
cd ak_sap
pip install flit
flit install --pth-file
Expand Down Expand Up @@ -111,12 +134,14 @@ sap.api_version #Returns Sap0API version number
sap.save(r'\Path\to\save\file.sdb')
```

To see module level usage, check out the [`Layout.md`](/documentation/Layout.md) or [`Usage.ipynb`](/documentation/Usage.ipynb)

### 3.1. GUI

The repo now supports a streamlit GUI for the wrapper. Checkout [`GUI.md`](/documentation/Usage/GUI.md) for instructions.

### 3.2. Layout Documentation

To see module level usage, check out the [`Layout.md`](/documentation/Layout.md) or [`Usage.ipynb`](/documentation/Usage.ipynb)

<!-- Roadmap -->
## 4. Roadmap

Expand All @@ -128,11 +153,13 @@ The repo now supports a streamlit GUI for the wrapper. Checkout [`GUI.md`](/docu
- [ ] Points
- [ ] Area
- [ ] Line
- [ ] Export joint reactions to Hilti-Profis file
- [ ] Export Frame/Wall sections to S-Concrete

<!-- License -->
## 5. License

See LICENSE for more information.
See [LICENSE](https://github.com/rpakishore/ak_sap/blob/main/LICENSE) for more information.

<!-- Contact -->
## 6. Contact
Expand Down
147 changes: 118 additions & 29 deletions documentation/Layout.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,31 @@
- [1. Layout](#1-layout)
- [1.1. Roadmap/Checklist](#11-roadmapchecklist)
- [1.2. Sub-Modules](#12-sub-modules)
- [1.2.1. Model](#121-model)
- [1.2.2. Element](#122-element)
- [1.2.3. Table](#123-table)
- [1.2.4. Loads](#124-loads)
- [1.2.4.1. Load Patterns](#1241-load-patterns)
- [1.2.4.2. Load Cases](#1242-load-cases)
- [1.2.4.3. Modal](#1243-modal)
- [1.2.4.3.1. Eigen](#12431-eigen)
- [Ritz](#ritz)

# 1. Layout

## 1.1. Roadmap/Checklist
<h1> Layout </h1>

- [1. Roadmap/Checklist](#1-roadmapchecklist)
- [2. Sub-Modules](#2-sub-modules)
- [2.1. Model](#21-model)
- [2.2. Element](#22-element)
- [2.2.1. Point](#221-point)
- [2.2.2. Frames](#222-frames)
- [2.3. Table](#23-table)
- [2.4. Loads](#24-loads)
- [2.4.1. Load Patterns](#241-load-patterns)
- [2.4.2. Load Cases](#242-load-cases)
- [2.4.3. Modal](#243-modal)
- [2.4.3.1. Eigen](#2431-eigen)
- [2.4.3.2. Ritz](#2432-ritz)
- [2.5. Results](#25-results)
- [2.6. Material](#26-material)
- [Rebar](#rebar)

# 1. Roadmap/Checklist

![MindMap](assets/mindmap.png)

## 1.2. Sub-Modules
# 2. Sub-Modules

### 1.2.1. Model
![MindMap](assets/mindmap.svg)

## 2.1. Model

Collection of methods and attributes that control changes to the model as a whole

Expand Down Expand Up @@ -48,19 +54,51 @@ sap.Model.logs #Retrieve user comments and logs
sap.Model.set_logs('Add this comment') #Adds user comments/logs
```

### 1.2.2. Element
## 2.2. Element

Collection of methods and attributes that apply changes to elements in the model

### 2.2.1. Point

Manipulate Point Elements

Usage Examples

```python
points = sap.Element.Point
len(points) #list number of points in model
points.add_by_coord((1,2,3)) #Add point to model
points.is_selected(name='1') #Check if point is selected
points.selected() #Yields selected points
points.all() #Lists all defined points
points.rename(old_name='1', new_name='1_1') #Rename point
points.check_element_legal(name='1') #Asserts point's existance
points.delete(name='1') #Delete point
```

### 2.2.2. Frames

Manipulate Frame Elements

Usage Examples

```python
##Points
len(sap.Element.Point) #list number of points in model
sap.Element.Point.add_by_coord((1,2,3)) #Add point to model
frames = sap.Element.Frame
len(frames) #list number of frames in model
frames.is_selected(name='1') #Check if frame is selected
frames.selected() #Yields selected frames
frames.all() #Lists all defined frames
frames.rename(old_name='1', new_name='1_1') #Rename frame
frames.check_element_legal(name='1') #Asserts frame's existance
frames.get_section(frame_name='1') #Get the assigned Section name
frames.get_points(frame_name='1') #Get points connected to frame
frames.delete(name='1') #Delete frame

frames.Prop.rename(old_name="FSEC1", new_name="MySection") #Rename frame property
frames.Prop.total() #Total # of defined frame properties
```

### 1.2.3. Table
## 2.3. Table

Control the database values

Expand All @@ -72,11 +110,11 @@ sap.Table.list_available() #Lists available database
sap.Table.list_all() #Lists all database tables
```

### 1.2.4. Loads
## 2.4. Loads

Control the definition and assignments of loads.

#### 1.2.4.1. Load Patterns
### 2.4.1. Load Patterns

Usage Examples

Expand All @@ -98,7 +136,7 @@ pattern.add(name='Custom Live', pattern_type='LIVE',
selfwt_multiplier=1.15, add_case=True)
```

#### 1.2.4.2. Load Cases
### 2.4.2. Load Cases

Usage Examples

Expand All @@ -112,11 +150,11 @@ cases.case_info(name='DEAD') #Get the Case type information
cases.set_type(name='DEAD', casetype='LINEAR_STATIC') #Change the case type of existing load case
```

#### 1.2.4.3. Modal
### 2.4.3. Modal

`sap.Load.Modal`

##### 1.2.4.3.1. Eigen
#### 2.4.3.1. Eigen

Usage Examples

Expand All @@ -143,7 +181,7 @@ eigen.set_number_modes(case_name='LCASE1', max=10, min=5) #set number of modes
eigen.get_number_modes(case_name='LCASE1') #get number of modes
```

##### Ritz
#### 2.4.3.2. Ritz

Usage Examples

Expand All @@ -159,3 +197,54 @@ ritz.get_loads(case_name='LCASE1') #Get the load data
ritz.set_number_modes(case_name='LCASE1', max=10, min=5) #set number of modes
ritz.get_number_modes(case_name='LCASE1') #get number of modes
```

## 2.5. Results

Manipulate Results from SAP2000

Usage Examples

```python
results = sap.Results

setup = sap.Results.Setup
setup.clear_casecombo() #Deselect all Case&Combo for results
setup.select_case(casename='DEAD') #sets an load case selected for output flag.
setup.is_selected_case(casename='DEAD') #checks if an load case is selected for output.
setup.select_combo(comboname='DEAD') #sets an load combo selected for output flag.
setup.is_selected_combo(comboname='COMB1') #checks if an load combo is selected for output.
setup.set_rxn_loc_get(x=0.5, y=0.5, z=5) #sets coordinates of the locn at which the base reactions are reported.
setup.base_rxn_loc_get() #retrieves coordinates of the locn at which the base reactions are reported.

results.joint_reactions(jointname='1') #Get Joint reactions as dict
```

## 2.6. Material

Usage Examples

```python
material = sap.Material
material.rename(old="4000Psi", new="MatConc") #Rename existing material
material.total() #Total # of defined material properties
material.delete(name='4000Psi') #Delete existing material property
material.list_all() #List all defined Material Properties
material.get_props(name='4000Psi') #Returns basic material property data
material.add(name='Steel', material_type='Steel') #Initialze Material Property
material.set_isotropic(name='Steel', E=29500, poisson=0.25, thermal_coeff=6e-06) #Set isotropic material properties
material.set_density(name='Steel', mass_per_vol=0.00029) #set density
```

### Rebar

Usage Examples

```python
rebar = sap.Material.Rebar
rebar.rename(old='R1', new='MyRebar') #Rename rebar
rebar.total() #Total # of defined rebar properties
rebar.delete(name='R1') #Delete existing rebar property
rebar.list_all() #List all defined rebar Properties
rebar.set_prop(name='MyRebar2', area=1.05, dia=1.0) #Define a rebar property
rebar.get_prop(name='MyRebar2') #Get rebar property
```
Loading

0 comments on commit 056490e

Please sign in to comment.