- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I need som code to assigning a material to a part in VBA.
can anyone help.
Dim oApp As Inventor.Application
Set oApp = ThisApplication
Dim oDoc As PartDocument
Set oDoc = oApp.ActiveDocument
Dim oPropsets As PropertySets
Set oPropsets = oDoc.PropertySets
Dim Mat As String
Mat = oPropsets.Item("{32853F0F-3444-11d1-9E93-0060B03C1CA6}").ItemByPropId(kMaterialDesignTrackingProperties).Value
Debug.Print Mat
Mat = "Hastelloy"
oPropsets.Item("{32853F0F-3444-11d1-9E93-0060B03C1CA6}").ItemByPropId(kMaterialDesignTrackingProperties).Value = Mat Debug.Print oPropsets.Item("{32853F0F-3444-11d1-9E93-0060B03C1CA6}").ItemByPropId(kMaterialDesignTrackingProperties).Value
but the material is not changed .....
Solved! Go to Solution.
