Sub Main

	Dim theModel As Model
	Dim theClasses As ClassCollection
	Dim theClass As Class
	Dim theOps As OperationCollection
	Dim theOp As Operation
	Dim theAtts As AttributeCollection
	Dim theAtt As Attribute
	Dim theParams As ParameterCollection
	Dim theParam As Parameter 
	

   	
	Set theModel = RoseApp.CurrentModel
	Set theClasses = theModel.GetSelectedClasses

	'Change this line to point to the location where you want your file to be created
	Open "C:\Myfile.txt" For Append As #1  	
	For i = 1 To theClasses.Count
	 	Set theClass = theClasses.GetAt(i)

		Print #1, theClass.Name
		Print #1, "     "
		Print #1, "Class Documentation: "
		Print #1, theClass.Documentation
		Print #1, "     "
		Print #1, "*****************************************"
		Print #1, "Attributes:"
		Print #1, "     "
		Set theOps = theClass.Operations
		Set theAtts = theClass.Attributes
			For j = 1 To theAtts.Count
	 			Set theAtt = theAtts.GetAt(j)

				Print #1, theAtt.Name & " : " & theAtt.Type, "Initial Value = " & theAtt.InitValue
				Print #1, "     "
				Print #1, "Attribute Documentation: "
				Print #1, theAtt.Documentation
			Next j

			Print #1, "   "
			Print #1, "   "
			Print #1, "Operations:"

			For k = 1 To theOps.Count
	 			Set theOp = theOps.GetAt(k)
				Set theParams = theOp.Parameters
				Print #1, theOp.Name & " : " & theOp.ReturnType	
				Print #1, "     "		
				Print #1, "Parameters:"
				Print #1, "     "
					For l = 1 To theParams.Count
	 					Set theParam = theParams.GetAt(l)
						Print #1, theParam.Name & " : " & theParam.Type, "Initial Value = " & theParam.InitValue
						Print #1, "     "
					Next l
				Print #1, "     "
				Print #1, "Operation Documentation: "
				Print #1, theOp.Documentation
			Next k	
			
			Print #1, "     "
			Print #1, "________________________________________"	
	Next i
	Close #1

	MsgBox "Done"

End Sub
