TAGGED: Ansys Discovery, script
-
-
September 19, 2023 at 4:36 am
Karan Bhuta
SubscriberI wanted to know in detail how does scripting store data for smart variables so I can avoid any future errors in my code. Is there any documentation related to this that can help me find it?
Thank you
-
September 20, 2023 at 7:33 pm
mjmiddle
Ansys EmployeeThe smart variables are binary data, so it normally would not be useful to see a bunch of hexadecimal values. If you save this script with this data, it must be saved as .scscript or .dscript type to retain the data. It can't be saved as plain text type file. You can see an XML conversion of the data if you highlight the script, then right click and select "Copy W/Metadata":
You will need to paste the contents to a text editor to see that data. If you save that script as a .scscript or .dscript type, then load into back into the Discovery script editor, it will interpret this XML data back to binary data, so you won't see it. It will then look just like any other script with recorded metadata variables.
The metadata selections are very much tied to the current model identifications. To make the script more readable, editable, and portable to different models, set the selection type to index:
You can make scripts even more robust by using a bottom-up creation method, meaning to create curves ("layout curves" in sketch mode), then surfaces, then solids, so you can keep the entities saved as variables are each creation function. You can get the list of entities from each creation function (that record a "result" return variable) with commands like these:
result.CreatedPlanes
result.CreatedCurves
result.CreatedBodies
result.CreatedFaces
-
- You must be logged in to reply to this topic.

Boost Ansys Fluent Simulations with AWS
Computational Fluid Dynamics (CFD) helps engineers design products in which the flow of fluid components is a significant challenge. These different use cases often require large complex models to solve on a traditional workstation. Click here to join this event to learn how to leverage Ansys Fluids on the cloud, thanks to Ansys Gateway powered by AWS.

Earth Rescue – An Ansys Online Series
The climate crisis is here. But so is the human ingenuity to fight it. Earth Rescue reveals what visionary companies are doing today to engineer radical new ideas in the fight against climate change. Click here to watch the first episode.

Ansys Blog
Subscribe to the Ansys Blog to get great new content about the power of simulation delivered right to your email on a weekly basis. With content from Ansys experts, partners and customers you will learn about product development advances, thought leadership and trends and tips to better use Ansys tools. Sign up here.
- Solver Pivot Warning in Beam Element Model
- Saving & sharing of Working project files in .wbpz format
- Understanding Force Convergence Solution Output
- User manual
- An Unknown error occurred during solution. Check the Solver Output…..
- What is the difference between bonded contact region and fixed joint
- The solver engine was unable to converge on a solution for the nonlinear problem as constrained.
- whether have the difference between using contact and target bodies
- Defining rigid body and contact
- Colors and Mesh Display
-
7742
-
4502
-
2957
-
1449
-
1322
© 2023 Copyright ANSYS, Inc. All rights reserved.