Modify the comment in an user Material vb

Modify the comment in an user Material vb

Anonymous
Not applicable
373 Views
2 Replies
Message 1 of 3

Modify the comment in an user Material vb

Anonymous
Not applicable

Hello Everyone,

 

I just create some new material for my custom library. But I can not access to modify the comment in it! Is there any way to that in this case? 

 

01.png

0 Likes
Accepted solutions (1)
374 Views
2 Replies
Replies (2)
Message 2 of 3

JhoelForshav
Mentor
Mentor
Accepted solution

Hi @Anonymous 

 

I havent really tried changing the material in the library because my librarys are read only and I don't have time right now. But I could change the comments in the documents local material using the commented out code below.

 

I think you should try something like this (uncommented out) and see if it works 🙂

 

Dim oAssetLib As AssetLibrary
oAssetLib = ThisApplication.AssetLibraries.Item("TIF Material Library")
Dim oAsset As Asset
oAsset = oAssetLib.MaterialAssets.Item("Steel 0202")
oAsset.Item("physmat_Comments").Value = "Comment goes here"


'---------------------------------Test------------------------------------------------
'ThisDoc.Document.ActiveMaterial.Item("physmat_Comments").Value = "Comment goes here"
'-------------------------------------------------------------------------------------

Edit: I took the time to test it on a material in a read/write library and it works!

0 Likes
Message 3 of 3

Anonymous
Not applicable

Many thank Mr.!