Cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted

Apply Material to the Part File.

Valued Contributor
Valued Contributor

Hello Team,

 

I'm back with an issue in Apply Material to the Part File.

 

I'm using ST8 Windows 10 with 32Gb Ram.

 

Note: Writing the code in Excel VBA.

 

I'm using the below Code to apply the Material to the part file.

If objProperty.Name = "Material" Then
     objProperty.Value = "M0 GOST 859-2001"
End if

yes, it is updating in the material table, but the problem is part "Face Style" is not updating.

mat.JPG

 

Below Material Table is with correct values:

 

image.pngMaterial Table with Real values

for that, I have written the below code to update the Face Style.

 

If objProperty.Name = "Face Style" Then
      objProperty.Value = "Copper"
      objProperty.Save
End If

Even also Material table is not updating with Face Style.

 

image.pngMaterial Table not updated Real values

So, Please let me know how to update the Material table to get proper properties to be applied to the part file.

 

Thanks & Regards

V.Sudheer

 

2 REPLIES

Re: Apply Material to the Part File.

Solution Partner Phenom Solution Partner Phenom
Solution Partner Phenom

Hi @VSudheer,

Use the MatTable object to chache the material of a part. You get it using

objMatTable = objApplication.GetMaterialTable()
     

Then use the of ApplyMaterial() or other methods of the object to change or query the material table.

Using Apply will change file property accordingly.

regards

JB
SE 2019, VS2017

Re: Apply Material to the Part File.

Valued Contributor
Valued Contributor

Thank You So much @JB.

 

It's working fine.

 

Regards

V.Sudheer