-
Carriage Return Text Search in Python STK
Hi, A particular Short Text attribute in a table has been filled with texts ending with carriage returns, but not on all records. In an effort to tidy up the data, the admin is developing a script whose intent is to search for records where the attribute value contains a carriage return. Is it possible in the STK to use…
-
What version of the SOAP API should we using ?
We have tools that are in interface with Granta MI, currenlty using the 15/11 version. Since our upgrade in 2023R1, this interface is not working. As a quick patch, what version should we be using in the short-term (2 years) ?
-
Viewing allowed discrete values for an attribute using Scripting Toolkit
Today I was asked if it's possible to view the permitted values for a discrete attribute without exporting any data. The answer is yes! Here's a code sample that does this: from GRANTA_MIScriptingToolkit import granta as mpymi = mpy.Session("localhost", autologon=True)db = mi.get_db(db_key="MI_Restricted_Substances")table…
-
Best way to save a Viewer URL as attribute
Scenario: A customer is looking to store in their datasheets a Viewer URL to the same datasheets. This is to have that URL easily available to any export processes they might have. If using the MI Python STK to do this, i imagine the script to be something like "for all records in this table, read their url and import it…
-
Granta MI - Cross database tabular links error 500 in STK3.2 / MI23R2
The scripting toolkit 3.2 documentation says cross database links are supported. But the last line in this code fails with the error. Can you take a look? I am on MI 23R2 and STK 3.2. Browse.GetAttributeDetails failed with code 500 and message: Tabular attribute xxx has cross database data. This interface version does not…
-
Update multiple static links for a record as a sequence
Hi, I am running a script of Granta MI STK 3.1 with Granta MI 2023 R1 where I create records in a table, then update different static links to other records in other tables. It seems that I can't update more than one link per run of the "record.set_links" command, is there a limitation there ? Many Thanks, Mickaël
-
Bulk fetching of Record release states?
Is it possible to bulk fetch the release states of a list of Record objects using the Streamlined STK? Looking at the .release_state property of the Record class, it looks like the .release_state property makes an individual call on first access. For some of the other record properties, such as color, or short_name, that…
-
Is there a way to assign a djordjevicsarkar_material to Q2D from a python gui? I found this line of
Is there a way to assign a djordjevicsarkar_material to Q2D from a python gui? I found this line of script to add, but somehow this is not working on q2d. Materials.add_djordjevicsarkar_material(name, permittivity, loss_tangent, test_frequency, dc_permittivity=None, dc_conductivity=None). What changes should I make to make…
-
Which GUIDs can I access in the Granta SDK?
Which GUIDs can I access in the Granta SDK? I see there are record GUIDs, but can I also access attribute GUIDs and Table GUIDs?
-
Move records without losing Meta-attributes with STK 3.1
Hi, Here is a question I got from a customer using Python STK 3.1 My Goal is to move existing records in the correct folder based on the attribute “Heat Treatment Type” ’s value. In the example below, if the two records have the value “Stress Relieved”, they should be moved to the corresponding folder: I have to do that…
-
Could Ansys include a `py.typed` file in the Granta STK for mypy compatibility?
We use the Granta STK regularly, but also use mypy, a static type-checker for Python. Taking a look at the actual STK files when installed, they all have type hints, but without the py.typed file, mypy cannot infer any of the type hints when linting code. While we can include this file manually by editing our…
-
Can you use Granta STK to scan a database for records, which have more than 100 points in a FDA?
Ansys solver can only handle a maximum of 100 data points per material property. If a curve has more than 100 data points on import Ansys Workbench returns an error. My client has a large database and is unsure of what is the best way to clean up the data to improve the experience for the simulation users. Could we use STK…
-
How do I find the latest compatible servicelayer versions with Granta STK?
Is there an easy way to get this? Also, where can we link these versions to Granta MI versions? Question posed by @Rali
-
Can you use Granta MI Text Import template to import multiple files using STK?
Can you use Granta MI Text Import template to import multiple text files using STK 2.3? Assuming the text import template is set up to work within Granta MI Import and python STK is being used to automate the process.
-
Pseudo Attributes Criteria Search using STK
Can you run a criteria search through a database/table using pseudo attributes with Granta MI Python Scripting Toolkit 2.3 ? For example finding all records within a given table that have been modified in the last 24 hours.
-
How to install the Granta STK in IronPython in Ansys?
There doesn't seem to be a way to just "pip install" something in IronPython. Is there a good way of installing packages, such as the Granta STK, in IronPython?
-
pip installing the Granta STK isn't working
I've followed the instructions and run pip install, but I keep getting syntax errors. What's going on?
-
I've just upgraded to Granta SDK 2.0 but where's the new API?
This is a common question I've received. I've just upgraded but when I try to do the import in the examples from GRANTA_MIScriptingToolkit import granta as mpy, it says that "granta" can't be found. What gives?
-
Is it possible to set data links for an attribute using the Granta STK?
"Is it possible to set data links for an attribute using the Granta STK?" Can it be done using the STK? I've not found a way to do it and I am using STK 2.0.
-
Can't install Granta SDK but I fulfill the requirements?
This was a customer question, reproduced here with identifying details removed. I tried to install the SDK v2.1 but I got an error saying it is not supported? I don't understand; I have python 3 and according to the documentation my version should be supported. What's going on? Details: * Windows 10 * Python 3.8 32 bit *…
-
Attributes won't populate using the Granta SDK/STK 2.0?
I am creating a new record using the granta stk 2.0, but when I look at it in viewer none of the attributes are populated. Where am I going wrong? my_record = mi_table.create_record('my record')my_record.attributes['record ID'] = '000IK'my_record = session.update([my_record])[0]