Thank you very much.
Just trying to get my head around your rule. This is how I interpret it.
'create a variable for a drawing document, then set its value
Dim oDDoc As DrawingDocument = ThisDrawing.Document
'that variable now represents our local drawing document
This is an instruction to look at the current open drawning.
'check if the model document this drawing is representing is a Part (specificly)
If ThisDrawing.ModelDocument.DocumentType = DocumentTypeEnum.kPartDocumentObject Then
'it is, so create a Part specific document variable, then set its value
Dim oPDoc As PartDocument = ThisDrawing.ModelDocument
'that variable now represents that part document
Checking to see if the model is a part/assembly. If it is then get the model name.
'create a String (text) type variable, to hold the part's name, then set its value
Dim oName As String = oPDoc.FullFileName
'that variable now represents that text
This is to get the full file name of the model.
'create a Double (number with decimal places) type variable, then set its value
'had to climb down through the object structure under that Part to get it
Dim oMass As Double = oPDoc.ComponentDefinition.MassProperties.Mass
'that variable now represents the Mass of the part
This is getting the mass from the full file name
'show the user (you) a message containing the data we collected about the part.
MsgBox("Model name = " & oName & vbCrLf & _
"Model Mass = " & oMass, , "")
This is putting that information together and showing it in a message box. However, I am not sure how this is working? i.e where are you getting "model name = " & oName & vbCrLf & _" From?
I just searched vbCrlf and realised it's just a line return. I think I understand what that last bit is doing now.