I changed the material using the vb.net code shown below.but after changing material the object is not updated ,the volume and mass didn't change ..why? any idea. here is my code
Dim oDoc As PartDocument
oDoc = inventorApp.ActiveDocument
Dim oDTProps As PropertySet
oDTProps = oDoc.PropertySets.Item("{32853F0F-3444-11d1-9E93-0060B03C1CA6}")
Dim oDesignerProp As Inventor.Property
oDesignerProp = oDTProps.ItemByPropId( _
PropertiesForDesignTrackingPropertiesEnum.kMaterialDesignTrackingProperties)
oDesignerProp = oDTProps.Item("Material")
oDesignerProp.Value = "Titanium"
oDoc.Update()
Solved! Go to Solution.
Solved by jdkriek. Go to Solution.
i tried this and it works but sometimes it takes awhile to update.
sometimes i have to go to the other open doc and back to see the updated material...
is there a code that can eliminate this delay update? or going back and forth to other open doc?
ive added doc.update but still no luck,.,,
inventor 2013
vault 2013
Try this this will help me and working fine....just update the mass using this code after changing the material.
Dim oPropSet As PropertySet oPropSet = oPartDoc.PropertySets("Design Tracking Properties") oPropSet.Item("Material").Value = DropDownList1.SelectedItem.Text Dim materialDef As Material = oPartDoc.Materials(DropDownList1.SelectedItem.Text) oPartDoc.ComponentDefinition.Material = materialDef oPartDoc.Update() Dim mass As Double = oPartDoc.ComponentDefinition.MassProperties.Mass oPartDoc.SaveAs("F:\inventor\Proof Of Con\Cube\Cube_update1.ipt", True) oPartDoc.SaveAs("F:\inventor\Proof Of Con\WebSite14\Documents\Cube_Update.ipt", True)
Can't find what you're looking for? Ask the community or share your knowledge.