Community
I have this code here that caculates a metric weight into a custom property. My problem is for some reason it's grabbing a random Level of Detail on a random sheet. While I realize it's probably not random. I'd like it to calculate from the Master Level of Detail or specify the sheet that it takes the weight from.
Here is the code I'm using
'Weight
doc = ThisDoc.Document
customPropertySet = doc.PropertySets.Item("Inventor User Defined Properties")
'Make sure TotalWT property exists
Try
prop = customPropertySet.Item("TotalWT")
Catch
'Assume error means not found
customPropertySet.Add("", "TotalWT")
End Try
'Find the filename of the model used in the drawing
If ThisDoc.ModelDocument Is Nothing Then
Goto handleErrors
ElseIf ThisDoc.ModelDocument.DocumentType = kPresentationDocumentObject
Goto handleErrors
Else
modeldocname = IO.Path.GetFileName(ThisDoc.ModelDocument.FullFileName)
End If
'Find the mass of the model used in the drawing
mass = iProperties.Mass(modeldocname)
Did anyone ever get you an answer for this. I have similar iLogic code and the total weight gets an error when I bring in multiple parts or view reps.