Repository.Model.IsModelUsed: Difference between revisions
Jump to navigation
Jump to search
Alex Ulanov (talk | contribs) |
Kate Racaza (talk | contribs) No edit summary |
||
Line 1: | Line 1: | ||
{{Template: | {{Template:APIBreadcrumb|10|Repository}} | ||
{{Template: | {{Template:API}} | ||
Checks whether the model with the ID number that you specify is used by other items in the project. Returns a '''Boolean''' value; when true, indicates that the model is in use. | |||
== Syntax== | == Syntax == | ||
IsModelUsed( | ''object''.'''Model.IsModelUsed(''ID'')''' | ||
where ''object'' is a variable that represents a Repository object. | |||
== | === Parameters === | ||
{| {{APITable}} | |||
|- | |||
|ID{{APIParam|Required}}||'''Integer'''. The ID number of the model to be checked. | |||
|} | |||
Dim | |||
== Example == | |||
{{APIComment|' | This example assumes that a model with ID# 42 exists in the repository. | ||
'''VBA|VB.NET'''<br> | |||
{{APIPrefix|Dim}} MyRepository {{APIPrefix|As New}} Repository | |||
{{APIComment|...'Add code to connect to a Synthesis repository.}} | |||
{{APIComment|' | {{APIComment|'Check whether model #42 in project #1 is in use.}} | ||
MyRepository.Project.SetCurrentProject(1) | |||
Dim CheckModel As Boolean | |||
CheckModel = MyRepository.Model.IsModelUsed(42) | |||
Dim | |||
{{APIComment|' | {{APIComment|'Output sample:}} | ||
{{APIPrefix|If}} CheckModel = {{APIPrefix|True Then}} | |||
MsgBox ({{APIString|"The model is in use."}}) | |||
{{APIPrefix|Else}} | |||
MsgBox ({{APIString|"The model is not in use."}}) | |||
{{APIPrefix|End If}} |
Revision as of 15:44, 14 July 2015
Member of: SynthesisAPI10Repository
Checks whether the model with the ID number that you specify is used by other items in the project. Returns a Boolean value; when true, indicates that the model is in use.
Syntax
object.Model.IsModelUsed(ID)
where object is a variable that represents a Repository object.
Parameters
Name | Description | |
---|---|---|
IDborder="0" cellpadding="5" cellspacing="0" style="border-collapse: collapse; text-align: left; cellborder" | ||
Name | Status | Integer. The ID number of the model to be checked. |
Example
This example assumes that a model with ID# 42 exists in the repository.
VBA|VB.NET
Dim MyRepository As New Repository ...'Add code to connect to a Synthesis repository. 'Check whether model #42 in project #1 is in use. MyRepository.Project.SetCurrentProject(1) Dim CheckModel As Boolean CheckModel = MyRepository.Model.IsModelUsed(42) 'Output sample: If CheckModel = True Then MsgBox ("The model is in use.") Else MsgBox ("The model is not in use.") End If