05-24-2022
11:20 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
05-24-2022
11:20 AM
Hi @utm007. Although that iLogic shortcut snippet will work to easily change material, the actual iProperty's value is ReadOnly. If you want to change the material of a part through VBA, you will most likely have to set a new value to the PartDocument.ActiveMaterial Property. That is a Read/Write property, but it is wanting you to supply an Asset, instead of just a material name. To get the Asset, you need to find the one for that material either within the document's materials (PartDocument.MaterialAssets) or one of the available material libraries (ThisApplication.ActiveMaterialLibrary). There are other ways too, but this is the main way.
Wesley Crihfield
(Not an Autodesk Employee)