Use Models for Functions
There are two common use models for the functions that take the tool and session object.
Working with Tools
Often you need to modify an item or option related to a tool. These types of operations might include the following:
- Adding an option to a tool
- Changing a tool option
- Deleting a tool option
- Setting a tool option’s value
- Getting a tool option (object)
You can set up a function in your .cdsinit file to do this. For example, suppose you wanted to set the following options for every new session.
You might add the following functions to your .cdsinit file:
asiSetEnvOptionVal( asiGetTool('Spectre) 'modelPath
"~/processA/best/models")
asiSetEnvOptionVal( asiGetTool('Spectre) 'includeFile
"~/processA/best/models/include")
Because these calls to asiSetEnvOptionVal are in the .cdsinit (before any sessions are opened), all subsequent sessions contain the specified model path and include file.
Getting Values from Sessions
Sometimes, you want to get a value from an existing session.
For example, when writing a custom SKILL code, you need to get the value of the transient to field for the existing session. In this case, you might use the following code:
session = asiGetCurrentSession()
analysis = asiGetAnalysis(session 'tran)
valueOfTo=asiGetAnalysisFieldVal( analysis 'to)
Return to top