Methods are written in VBScript and perform actions on objects when they are invoked by other extensions, such as menu items or form buttons.
For more information on defining a script and using the Global Script tab, see Example: PDM Custom Check and Global Script (Profile).
The following example, created under the Class metaclass, converts classes into interfaces by copying basic class properties and operations, deleting the class (to avoid namespace problems), and creating the new interface.
Sub %Mthd%(obj) ' Convert class to interface ' Copy class basic properties Dim Folder, Intf, ClassName, ClassCode Set Folder = obj.Parent Set Intf = Folder.Interfaces.CreateNew ClassName = obj.Name ClassCode = obj.Code Intf.Comment = obj.Comment ' Copy class operations Dim Op For Each Op In obj.Operations ' ... Output Op.Name Next ' Destroy class obj.Delete ' Rename interface to saved name Intf.Name = ClassName Intf.Code = ClassCode End Sub