-
Notifications
You must be signed in to change notification settings - Fork 35
Base Settings Added #60
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
b4a8ea9
bas_settings_added
d121545
Merge branch 'main' into dogukaratas-BaseDataSettings
jarabroz 8acaa64
requested_changes
3b1a1df
Merge branch 'main' into dogukaratas-BaseDataSettings
jarabroz 615f686
Merge branch 'main' into dogukaratas-BaseDataSettings
jarabroz 66a6bb1
Update of the test
jarabroz File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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,38 @@ | ||
| import sys | ||
| sys.path.append(".") | ||
| from RFEM.Loads.surfaceLoad import * | ||
| from RFEM.Loads.memberLoad import * | ||
| from RFEM.Loads.nodalLoad import * | ||
| from RFEM.LoadCasesAndCombinations.loadCase import * | ||
| from RFEM.LoadCasesAndCombinations.staticAnalysisSettings import * | ||
| from RFEM.TypesForMembers.memberHinge import * | ||
| from RFEM.TypesForNodes.nodalSupport import * | ||
| from RFEM.BasicObjects.solidSet import * | ||
| from RFEM.BasicObjects.surfaceSet import * | ||
| from RFEM.BasicObjects.memberSet import * | ||
| from RFEM.BasicObjects.lineSet import * | ||
| from RFEM.BasicObjects.opening import * | ||
| from RFEM.BasicObjects.solid import * | ||
| from RFEM.BasicObjects.surface import * | ||
| from RFEM.BasicObjects.member import * | ||
| from RFEM.BasicObjects.line import * | ||
| from RFEM.BasicObjects.node import * | ||
| from RFEM.BasicObjects.thickness import * | ||
| from RFEM.BasicObjects.section import * | ||
| from RFEM.BasicObjects.material import * | ||
| from RFEM.initModel import * | ||
| from RFEM.dataTypes import * | ||
| from RFEM.enums import * | ||
| from RFEM.baseSettings import * | ||
|
|
||
| if __name__ == '__main__': | ||
|
|
||
| clientModel.service.begin_modification() | ||
|
|
||
| # Set Base Settings | ||
| BaseSettings(12, GlobalAxesOrientationType.E_GLOBAL_AXES_ORIENTATION_ZUP, LocalAxesOrientationType.E_LOCAL_AXES_ORIENTATION_ZUP, [0.001, 0.002, 0.003, 0.004]) | ||
|
|
||
| print('Ready!') | ||
|
|
||
| clientModel.service.finish_modification() | ||
|
|
This file contains hidden or 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,60 @@ | ||
| from RFEM.initModel import * | ||
| from RFEM.enums import * | ||
| from enum import Enum | ||
|
|
||
| class BaseSettings(): | ||
| def __init__(self, | ||
| gravitational_acceleration: int = 10, | ||
| global_axes_orientation = GlobalAxesOrientationType.E_GLOBAL_AXES_ORIENTATION_ZDOWN, | ||
| local_axes_orientation = LocalAxesOrientationType.E_LOCAL_AXES_ORIENTATION_ZDOWN, | ||
| tolerances = [0.0005, 0.0005, 0.0005, 0.0005], | ||
| member_representatives: bool = False, | ||
| member_set_representatives: bool = False): | ||
| """ | ||
| Args: | ||
| gravitational_acceleration (int): Gravitational Acceleration (m/sn2) | ||
| global_axes_orientation (enum): Global Axes Orientation Enumeration | ||
| local_axes_orientation (Enum): Local Axes Orientation Enumeration | ||
| tolerances (list): Tolerances | ||
| member_representatives (bool): Member Representatives | ||
| member_set_representatives (bool): Member Set Representatives | ||
|
|
||
| tolerances = [tolerance_for_nodes, tolerance_for_lines, tolerance_for_surfaces_and_planes, tolerance_for_directions] | ||
| """ | ||
| # Client model | Load Case | ||
| clientObject = clientModel.factory.create('ns0:model_settings_and_options_type') | ||
|
|
||
| # Clears object atributes | Sets all atributes to None | ||
| clearAtributes(clientObject) | ||
|
|
||
| # Gravitational Acceleration | ||
| clientObject.gravitational_acceleration = gravitational_acceleration | ||
|
|
||
| # Global Axes Orientation | ||
| clientObject.global_axes_orientation = global_axes_orientation.name | ||
|
|
||
| # Local Axes Orientation | ||
| clientObject.local_axes_orientation = local_axes_orientation.name | ||
|
|
||
| # Tolerances | ||
| if len(tolerances) == 4: | ||
| pass | ||
| else: | ||
| raise Exception("WARNING:Expected size of the array. Kindly check the list correctness.") | ||
|
|
||
| clientObject.tolerance_for_nodes = tolerances[0] | ||
| clientObject.tolerance_for_lines = tolerances[1] | ||
| clientObject.tolerance_for_surfaces_and_planes = tolerances[2] | ||
| clientObject.tolerance_for_directions = tolerances[3] | ||
|
|
||
| # Member Representatives | ||
| clientObject.member_representatives_active = member_representatives | ||
|
|
||
| # Member Set Representatives | ||
| clientObject.member_set_representatives_active = member_set_representatives | ||
|
|
||
| # Add Base Data Settings to client model | ||
| clientModel.service.set_model_settings_and_options(clientObject) | ||
|
|
||
|
|
||
|
|
||
This file contains hidden or 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
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or 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,25 @@ | ||
| import sys | ||
| sys.path.append(".") | ||
| import pytest | ||
| from RFEM.enums import * | ||
| from RFEM.baseSettings import * | ||
|
|
||
|
|
||
| def test_base_settings_implemented(): | ||
|
|
||
| exist = method_exists(clientModel,'set_model_settings_and_options') | ||
| assert exist == False #test fail once method is in T9 master or GM | ||
|
|
||
|
|
||
| @pytest.mark.skip("all tests still WIP") | ||
| def test_baseSettings(): | ||
|
|
||
| clientModel.service.begin_modification() | ||
|
|
||
| # Set Base Settings | ||
| BaseSettings(12, GlobalAxesOrientationType.E_GLOBAL_AXES_ORIENTATION_ZUP, LocalAxesOrientationType.E_LOCAL_AXES_ORIENTATION_ZUP, [0.001, 0.002, 0.003, 0.004]) | ||
|
|
||
| print('Ready!') | ||
|
|
||
| clientModel.service.finish_modification() | ||
|
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.