Repository.Model.DeleteModel: Difference between revisions

From ReliaWiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 3: Line 3:


<onlyinclude>Deletes an unused model from the current project. Throws an exception if the model is in use. Returns a '''Boolean''' value; when true, indicates a successful deletion.</onlyinclude>
<onlyinclude>Deletes an unused model from the current project. Throws an exception if the model is in use. Returns a '''Boolean''' value; when true, indicates a successful deletion.</onlyinclude>


== Syntax ==
== Syntax ==
  '''.Model.DeleteModel'''(''ID'')
  '''.Model.DeleteModel'''(''ID'')
=== Parameters ===
=== Parameters ===
''ID''
''ID''
:Integer. The ID number of the model to delete.
:Required. Integer. The ID number of the model to delete.




== Example ==
== Example ==
This example assumes that an unused model with ID#71 exists in a repository.
This example assumes that an unused model with ID #71 exists in the first project of a Synthesis repository.
  '''VBA|VB.NET'''
  '''VBA|VB.NET'''
   
   
Line 22: Line 21:
   
   
   
   
  {{APIComment|'Delete model #71 from project #1. The model will no longer be visible in the Synthesis repository upon refresh.}}
  {{APIComment|'Delete model #71 from project #1.}}
   MyRepository.Project.SetCurrentProject (1)
   MyRepository.Project.SetCurrentProject(1)
   MyRepository.Model.DeleteModel(71)
   MyRepository.Model.DeleteModel(71)

Revision as of 23:45, 24 August 2015

APIWiki.png


Member of: SynthesisAPI10Repository


Deletes an unused model from the current project. Throws an exception if the model is in use. Returns a Boolean value; when true, indicates a successful deletion.

Syntax

.Model.DeleteModel(ID)

Parameters

ID

Required. Integer. The ID number of the model to delete.


Example

This example assumes that an unused model with ID #71 exists in the first project of a Synthesis repository.

VBA|VB.NET

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


 'Delete model #71 from project #1. 
 MyRepository.Project.SetCurrentProject(1)
 MyRepository.Model.DeleteModel(71)