Skip to content

Commit

Permalink
build(release): merge branch develop (release 0.2.0)
Browse files Browse the repository at this point in the history
  • Loading branch information
marcantondahmen committed Jul 9, 2021
2 parents e5e2c95 + fbebaf2 commit 5c2d059
Show file tree
Hide file tree
Showing 25 changed files with 1,108 additions and 10 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
__pycache__
/docs/build
/.vscode
/.vscode
/tests/temp
46 changes: 46 additions & 0 deletions bin/tests.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
#!/bin/sh

revitVersion=2022
glob="test_*.py"

cd "`dirname $0`/.."
revitronDir=`pwd`
testsPy="$revitronDir/tests/run.py"
testsTemp="$revitronDir/tests/temp"
testsRvt="$testsTemp/tests.rvt"
testsLog="$testsTemp/tests.log"
testsConfig="$testsTemp/config.json"

mkdir -p $testsTemp

while getopts 'g:r:' opt; do
case $opt in
g)
glob=$OPTARG
;;
r)
revitVersion=$OPTARG
;;
\?)
echo "$opt is not a valid option"
exit 0
esac
done

echo "{ \"glob\": \"$glob\" }" > $testsConfig

cd "$revitronDir/../.."

bin/pyrevit run $testsPy $testsRvt --revit=$revitVersion --purge

clear

echo
echo "Revitron Unit Tests"
echo "======================================================================"
echo "Test pattern: $glob"
echo "Revit version: $revitVersion"
echo "----------------------------------------------------------------------"
echo

cat $testsLog
4 changes: 4 additions & 0 deletions docs/source/_static/custom.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
html.dark {
--bg-highlight: transparent;
}

.landing .headerlink:after {
display: none !important;
}
Expand Down
2 changes: 1 addition & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@

napoleon_google_docstring = True
napoleon_include_init_with_doc = True
napoleon_include_private_with_doc = True
napoleon_include_private_with_doc = False
napoleon_include_special_with_doc = True
napoleon_use_admonition_for_examples = False
napoleon_use_admonition_for_notes = True
Expand Down
1 change: 0 additions & 1 deletion docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,5 @@ Revitron

Revitron UI <https://revitron-ui.readthedocs.io/>
User Guide <https://revitron-ui.readthedocs.io/en/latest/user-guide.html>
Unit Tests <https://github.com/revitron/revitron-tests>
GitHub <https://github.com/revitron/revitron>
♡ Sponsor <https://github.com/sponsors/marcantondahmen>
9 changes: 9 additions & 0 deletions docs/source/revitron.grid.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
revitron.grid
=============

.. automodule:: revitron.grid
:members:
:undoc-members:
:inherited-members:
:show-inheritance:
:autosummary:
1 change: 1 addition & 0 deletions docs/source/revitron.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ Submodules
revitron.failure
revitron.filter
revitron.geometry
revitron.grid
revitron.link
revitron.parameter
revitron.raytrace
Expand Down
3 changes: 2 additions & 1 deletion revitron/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@
from revitron.failure import *
from revitron.filter import *
from revitron.geometry import *
from revitron.grid import *
from revitron.link import *
from revitron.parameter import *
from revitron.raytrace import *
Expand All @@ -121,7 +122,7 @@
DB = Autodesk.Revit.DB
LIB_DIR = parent(parent(__file__))
REVIT_VERSION = pyrevit.HOST_APP.uiapp.Application.VersionNumber
REVITRON_VERSION = '0.1.8'
REVITRON_VERSION = '0.2.0'


def _(element):
Expand Down
28 changes: 26 additions & 2 deletions revitron/create.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,31 @@ def familyInstance(familySymbolId, location, structuralType = False):
if not familySymbol.IsActive:
familySymbol.Activate()
return revitron.DOC.Create.NewFamilyInstance(location, familySymbol, structuralType)



@staticmethod
def GridLineLinear(start, end, name):
"""
Create a new linear grid line.
Args:
start (object): A Revit ``XYZ`` element
end (object): A Revit ``XYZ`` element
name (string): The grid name
Returns:
object: A Revit grid element
"""
import revitron
line = revitron.DB.Line.CreateBound(start, end)
try:
grid = revitron.DB.Grid.Create(revitron.DOC, line)
grid.Name = name
return grid
except:
revitron.Log().error('Can\'t create grid line "{}"'.format(name))
return None


@staticmethod
def roomTag(room, location, typeId = False, viewId = False):
Expand Down Expand Up @@ -130,7 +154,7 @@ def roomTag(room, location, typeId = False, viewId = False):
if tag.IsValidType(typeId):
tag.ChangeTypeId(typeId)

return tag
return tag


@staticmethod
Expand Down
3 changes: 3 additions & 0 deletions revitron/filter.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,9 @@ def byClass(self, cls):
"""
Filters the collection by class.
Args:
cls (class): A class to filter the elements
Returns:
object: The Filter instance
"""
Expand Down

0 comments on commit 5c2d059

Please sign in to comment.