ST7 - MP2 problem with material API

Reading the changelog there is this two statements:


PR 1998444: Abort trying to get access to material Table via API
PR 7224772: Old material library APIs do not work for a single material library


Well, I wondered what was wrong before cause I never had problems.


Now with this MP my usual routine to set a material doesn't work anymore !


What should i do ?


Dim objMatTable As MatTable
Set objMatTable = objApp.GetMaterialTable
objMatTable.SetActiveDocument objApp.ActiveDocument
objMatTable.ApplyMaterial objApp.ActiveDocument, cMateriale.Text


above the code written for V20 that was working in all version up to ST7 MP1


Not happy at all


Re: ST7 - MP2 problem with material API

There are more strange things going on with MP2.
Perhaps they have changed some program code so your macro is not working anymore.
About the code, can't help you. Programming is not my cup of coffee (not a huge fan of tea Smiley Wink ).
Daniël Schuiling
Solid Edge ST7
Teamcenter 10

Re: ST7 - MP2 problem with material API

I have solved it using the "ApplyMaterialToDoc" method.
It is still a bug in the API to deal with.

Re: ST7 - MP2 problem with material API

Not all the bugs comes without a reason.
I found that the "ApplyMAterialToDoc" method is much much faster than the previous one.

So now my program speed is greatly improved.