Hello Alexander
Try this (I think you forget the affectation)

     set aktModell = objRoseApp.CurrentModel


                                                                                       
         
                    "G�ntsch,                                                          
         
                    Alexander"                 Pour :  "'Rose Forum'" 
<[EMAIL PROTECTED]> 
                    <Alexander.Guentsch        cc :                                    
         
                    @blb.de>                   Objet :      (ROSE) Developing addins: 
Deleting  
                    Envoy� par :               a RoseItem                              
         
                    owner-rose_forum@ra                                                
         
                    tional.com                                                         
         
                                                                                       
         
                                                                                       
         
                    15/02/2002 17:58                                                   
         
                    Veuillez r�pondre �                                                
         
                    "G�ntsch,                                                          
         
                    Alexander"                                                         
         
                                                                                       
         
                                                                                       
         



Hello,

I'm just about developing an addin for rose and trying to implement the
following functionality:

In certain cases the user is not allowed to create a new class (for example
by clicking the class icon in the toolbar and then in the diagram).

So I registered for the NewModelElementEvent and try to delete the class
afterwards:

Public Sub OnNewModelElement(objRoseApp As RoseApplication, objItem As
RoseItem)

...

    If aktuelleAnsicht <> ANSICHT.MODELL Then
        Dim res As VbMsgBoxResult
        Dim aktModell As RoseModel
        res = MsgBox("...Message...", vbOKOnly, "Error")
        aktModell = objRoseApp.CurrentModel

        MsgBox "Name " + objItem.Name +
aktModell.GetAllClasses.GetWithUniqueID(objItem.GetUniqueID).Name ' for
debug purposes
        aktModell.RootCategory.DeleteClass
(aktModell.GetAllClasses.GetWithUniqueID(objItem.GetUniqueID))
    End If

End Sub

What happens is: When I create a class (and the condition aktuelleAnsicht
<> ANSICHT.MODELL is true) the first msgbox appears but not the second one
(the one beginning with "Name").

So: If I have a RoseItem that is a class, how can I delete it?

Thank you in advance,

Alexander

************************************************************************
* Rose Forum is a public venue for ideas and discussions.
* For technical support, visit http://www.rational.com/support
*
* Post or Reply to: [EMAIL PROTECTED]
* Subscription Requests: [EMAIL PROTECTED]
* Archive of messages:
*    http://www.rational.com/support/usergroups/rose/rose_forum.jsp
* Other Requests: [EMAIL PROTECTED]
*
* To unsubscribe from the list, please send email
*    To: [EMAIL PROTECTED]
*    Subject: <BLANK>
*    Body: unsubscribe rose_forum
*************************************************************************

Reply via email to