Community
Inventor Forum
Welcome to Autodesk’s Inventor Forums. Share your knowledge, ask questions, and explore popular Inventor topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

ILogic and Dual Weights

1 REPLY 1
Reply
Message 1 of 2
benjoefoe
273 Views, 1 Reply

ILogic and Dual Weights

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)
Thanks, Ben

AutoDesk Inventor 2020 Certified
1 REPLY 1
Message 2 of 2
sjsmith1247
in reply to: benjoefoe

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.

IV 2013 SP4

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report