-
Notifications
You must be signed in to change notification settings - Fork 3
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
Pymechanical update1 #69
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||
---|---|---|---|---|---|---|---|---|
|
@@ -69,15 +69,18 @@ | |||||||
|
||||||||
# BREAK BLOCK | ||||||||
from ansys.mechanical.core import App | ||||||||
|
||||||||
app = App(version=241) | ||||||||
print(app) | ||||||||
# BREAK BLOCK | ||||||||
|
||||||||
# Extract the global API entry points (available from built-in Mechanical scripting) | ||||||||
from ansys.mechanical.core import global_variables | ||||||||
# Merge them into your Python global variables | ||||||||
globals().update(global_variables(app)) | ||||||||
# Optional argument for Enums without namespaces | ||||||||
globals().update(global_variables(app),True) | ||||||||
# Import Python modules shipped with Mechanical | ||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||
from ansys.mechanical.core.embedding import add_mechanical_python_libraries | ||||||||
add_mechanical_python_libraries(241) | ||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Two comments -
|
||||||||
# BREAK BLOCK | ||||||||
ExtAPI # Application.ExtAPI | ||||||||
DataModel # Application.DataModel | ||||||||
|
@@ -89,16 +92,13 @@ | |||||||
file = r"D:\\Workdir\\bracket.mechdb" | ||||||||
app.open(file) | ||||||||
allbodies = DataModel.Project.Model.GetChildren( | ||||||||
Ansys.Mechanical.DataModel.Enums.DataModelObjectCategory.Body, | ||||||||
True) | ||||||||
DataModelObjectCategory.Body,True) | ||||||||
print(allbodies.Count) | ||||||||
# BREAK BLOCK | ||||||||
import logging | ||||||||
from ansys.mechanical.core import App | ||||||||
from ansys.mechanical.core.embedding.logger import ( | ||||||||
Configuration, | ||||||||
Logger) | ||||||||
|
||||||||
Configuration,Logger) | ||||||||
Configuration.configure(level=logging.WARNING, to_stdout=True) | ||||||||
app = App(version=241) | ||||||||
Logger.error("message") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This has been modified with latest way of updating globals