Repository.Model.IsModelUsed: Difference between revisions

From ReliaWiki
Jump to navigation Jump to search
No edit summary
mNo edit summary
Line 1: Line 1:
{{Template:API}}{{Template:APIBreadcrumb|10|.[[Repository Class|Repository]]}}
{{Template:API}}{{Template:APIBreadcrumb|.[[Repository Class|Repository]]}}





Revision as of 22:16, 13 November 2015

APIWiki.png


Member of: SynthesisAPI.Repository


Checks whether the model with the designated ID number is used by other items in the project. Returns a Boolean value; when true, indicates that the model is in use.

Syntax

.Model.IsModelUsed(ID)

Parameters

ID

Required. Integer. The ID number of the model to be checked.


Example

This example assumes that a model with ID #42 exists in the first available project of a Synthesis repository.

VBA|VB.NET

 'Add code to connect to a Synthesis repository. 
 Dim MyRepository As New Repository
 ... 
 

 'Check whether model #42 from project #1 is in use. 
 Dim CheckModel As Boolean
 MyRepository.Project.SetCurrentProject(1)  
 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