Repository.Model.DeleteModel: Difference between revisions

From ReliaWiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 1: Line 1:
<noinclude>{{Template:API}}{{Template:APIBreadcrumb|10|[[Repository Class|Repository]]}}</noinclude>
<noinclude>{{Template:API}}{{Template:APIBreadcrumb|10|[[Repository Class|Repository]]}}</noinclude>


Deletes an unused model from the Synthesis repository. Throws an exception if the model is in use. Returns a '''Boolean''' value; when true, indicates that the model no longer exists.  
 
Deletes an unused model from the current project. Returns a '''Boolean''' value; when true, indicates a successful deletion.
 
Throws an exception if the model is in use.
<noinclude>
<noinclude>
== Syntax ==
== Syntax ==
''object''.'''Model.DeleteModel(''ID'')'''
'''.Model.DeleteModel'''(''ID'')
 
where ''object'' is a variable that represents a Repository object.
 
=== Parameters ===
=== Parameters ===
{| {{APITable}}
''ID''
|-
:Integer. The ID number of the model to delete.
|ID{{APIParam|Required}}||'''Integer'''. The ID number of the model to delete.
|}




Line 19: Line 17:
  '''VBA|VB.NET'''
  '''VBA|VB.NET'''
   
   
  {{APIPrefix|Dim}} MyRepository {{APIPrefix|As New}} Repository
{{APIComment|'Add code to connect to a Synthesis repository.}}
{{APIComment|...'Add code to connect to a Synthesis repository.}}   
  {{APIPrefix|Dim}} MyRepository {{APIPrefix|As New}} Repository
  {{APIComment|...}}  
   
   
   
  {{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. The model will no longer be visible in the Synthesis repository upon refresh.}}

Revision as of 20:56, 20 July 2015

APIWiki.png


Member of: SynthesisAPI10Repository


Deletes an unused model from the current project. Returns a Boolean value; when true, indicates a successful deletion.

Throws an exception if the model is in use.

Syntax

.Model.DeleteModel(ID)

Parameters

ID

Integer. The ID number of the model to delete.


Example

This example assumes that an unused model with ID#71 exists in a repository.

VBA|VB.NET

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


 'Delete model #71 from project #1. The model will no longer be visible in the Synthesis repository upon refresh. 
 MyRepository.Project.SetCurrentProject (1)
 MyRepository.Model.DeleteModel(71)