Reply

Gage selection using vb.net

HI All,

 

Can anyone give some idea, about how to select the sheetmetal gage number from vb.net.

 

more in detail, calling the gage list to combobox & apply selected item from combobox to solid edge sheetmetal part.

 

Please give more ideas & details about this.

 

Advance Christmas And New Year Wishes to all.

 

Bala.

4 REPLIES

Re: Gage selection using vb.net

I believe, I have already posted the following code some time ago, as I could find it in my code collection, but I could not find the original post.

I also did not test again this code, but it should read the gauge table from the Excel file and then apply the first gauge values to the active document.

It should be easy for you to put the values into a combo box and let the user select a gauge.

'----------------------------------------------------------------------
' PSM: Change material thickness and apply to model
'----------------------------------------------------------------------
Dim objDoc As SheetMetalDocument = objApp.ActiveDocument
Dim objMatTable As MatTable = objApp.GetMaterialTable()
Dim strMaterial As String = ""
objMatTable.GetCurrentMaterialName(objDoc, strMaterial)
If String.IsNullOrEmpty(strMaterial) Then strMaterial = "Stainless Steel"
Dim nGages As Integer = 0
Dim gages() As Object = Nothing
objMatTable.GetPSMGaugeListFromExcel(strMaterial, nGages, gages)
objMatTable.SetDocumentToGageTableAssociation(objDoc, gages(0), strMaterial, True, True)

Re: Gage selection using vb.net

[ Edited ]

Hi Martin,

 

Thanks for your reply.

 

can you please give some ideas to extract the gage from "Solidedge Material Table" -->"Sheet metal gage"

 

Thanks,

Bala.

Re: Gage selection using vb.net

Which version of SE are you using?

I recognized that the GetPSMGaugeListFromExcel() method was only added in ST5, but it's this method which will return all available gages.

Re: Gage selection using vb.net

Hi Martin,

 

Thanks for your Reply.

 

I am using ST6.

 

Your code helping me to get gage data from excel. not from Material library file(Material.mtl).

 

Please give some idea to take out from "Material.mtl" file.

 

Thanks,

Bala.