I am going to rewrite my AddIn I made for the Autodesk Inventor software. It is supposed to do specific task that are not available by default in the program.
I am not a programmer but a draftsman that is interested in programming, so bare with me.
The reason for me to rewrite my program is to make it better documented and commented. Plus there is alot of code that is duplicated and hardcoded lines that must be removed.
Now I made a small sample for a class that I am doing, and how I think it should be commented and xml documented. Please feel free to comment on ALL the code not only the xml tags.
Imports Inventor
''' <summary>
''' The document object represents the Inventor Document,
''' it allows the you to rapidly access certain values and perform specific tasks
''' </summary>
Public Class Document
''' <summary>
''' Read-only property that returns the <c>Inventor.Document</c> that is associative with the XT document.
''' </summary>
''' <example>Document.ReferencedDocument() As Inventor.Document</example>
Public Overridable ReadOnly Property ReferencedDocument As Inventor.Document
''' <summary>
''' Creates a new XT document object
''' </summary>
''' <param name="InventorDocument">The Inventor document where the new XT document will be associated with.</param>
''' <example>Dim XTdocument as New Document(InventorDocument As Inventor.Document)</example>
Public Sub New(ByVal InventorDocument As Inventor.Document)
' Store the InventorDocument as ReferencedDocument
ReferencedDocument = InventorDocument
End Sub
''' <summary>
''' Gets the description of the current document
''' </summary>
''' <returns>string</returns>
Public Property Description As String
Get
' Set reference to the document property sets
Dim oPropertySets As PropertySets =
ReferencedDocument.PropertySets
' Set reference to the Design Tracking Property set
Dim oDesignTrackingPropertySet As PropertySet =
oPropertySets.Item("Design Tracking Properties")
' Set reference to the Description property
Dim oDescriptionProperty As [Property] =
oDesignTrackingPropertySet.Item("Description")
' Return the description value (as string)
Description = oDescriptionProperty.Value
End Get
Set(value As String)
' Set reference to the document property sets
Dim oPropertySets As PropertySets =
ReferencedDocument.PropertySets
' Set reference to the Design Tracking Property set
Dim oDesignTrackingPropertySet As PropertySet =
oPropertySets.Item("Design Tracking Properties")
' Set reference to the Description property
Dim oDescriptionProperty As [Property] =
oDesignTrackingPropertySet.Item("Description")
' Return the description value (as string)
oDescriptionProperty.Value = value
End Set
End Property
End Class