- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hey Guys,
I'm trying to transfer the sheetmetal 'Thickness' Parameter to the "Manager" Inventor iProperty but can't figure out what I don't know on what code to add. Any help is appreciated. Here's the Code I'm trying to use:
' Open assembly file and add assembly filename to 'Authority' iProperty if it doesn't exist
' Open and activate assembly file
Dim openDoc As Document = ThisDoc.Document
' Get the assembly filename
Dim oAssyFileName As String = ThisDoc.FileName(False)
'MessageBox.Show(oAssyFileName, "oAssyFileName")
' Access all part files in assembly
Dim docFile As Document
If openDoc.DocumentType = kAssemblyDocumentObject Then
For Each docFile In openDoc.AllReferencedDocuments
'Check for sheetmetal document type
'If openDoc = kSheetmetalDocumentObject Then
' Get the part's sheetmetal "Thickness" Parameter
Dim oThickness As Double
On Error Resume Next
oThickness = Round((docFile.ComponentDefinition.Parameters.Item("Thickness").Value * .3937), 3)
'MessageBox.Show(oThickness, "oThickness")
' Change the value of 'Manager' iProperty to 'Thickness' Parameter
docFile.PopertySets.Item("Inventor Document Summary Information").Item("Manager").Value = oThickness
' Change the value of 'Authority' iProperty to 'oAssyFileName' iProperty
docFile.PropertySets.Item("Design Tracking Properties").Item("Authority").Value = oAssyFileName
'End If
Next
Else
MessageBox.Show("You must have a valid Assembly document open before using this code!", _
"File Type Mismatch!", MessageBoxButtons.OK, MessageBoxIcon.Exclamation)
End If
This is the line that's giving me trouble:
' Change the value of 'Manager' iProperty to 'Thickness' Parameter docFile.PopertySets.Item("Inventor Document Summary Information").Item("Manager").Value = oThickness
What I don't understand is WHY it works with the assembly's FileName but not with the Parameter? I tried at least a dozen things to see if it was my error, such as mis-spelled words, converting a Double to Text, different ways to access the iProperty, etc. But STILL, I don't know rabbithole I need to go down to ensure I'm tapping into the values I need and correctly passing them on to where they need to go.
Also, will someone please tell me how to colorize the words when I post them in this snipped area?
Thanx for the help!
Win 7 Pro 64 bit + IV 2010 Suite
ASUS X79 Deluxe
Intel i7 3820 4.4 O/C
64 Gig ADATA RAM
Nvidia Quadro M5000 8 Gig
3d Connexion Space Navigator
Solved! Go to Solution.