05-26-2022
07:57 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
05-26-2022
07:57 AM
Oh, my mistake. I forgot to add the 'Set' keyword at the start of those two lines of code, because they are setting a value to the variable.
So change this:
oMyMaterial = oMaterial
to this:
Set oMyMaterial = oMaterial
And change this:
oMyMaterial = oMaterial.CopyTo(pDoc)
to this:
Set oMyMaterial = oMaterial.CopyTo(pDoc)
Also...
Change the following line of code:
For Each oMaterial In ThisApplication.ActiveMaterialLibrary
to add the additional step at the end like this:
For Each oMaterial In ThisApplication.ActiveMaterialLibrary.MaterialAssets
I did not test it before posting it, because I knew I did not have a material by that name.
Wesley Crihfield
(Not an Autodesk Employee)