API SeeSee if a rating exists

Hello everyone,

 

I am currently developing under VB.Net an automatic part generation software and to do so I would need to know if a named dimension exists but no way to find this in the solidwokrs help is anyone have a lead

Currently I change the rating in this way but no way to know if the change was successful or not :/

Part.Parameter(CoteToChange.). SystemValue = Round(CoteToChange.Value, 0) / 1000

Hello

But if the rating doesn't exist, the program will return an error, right?

In this case, we must refer to error handling: 

With an "On error go to" and a message or a warning for example.

http://gilmir.developpez.com/tutoriels-vb6/tutoriel16/

 

In fact I found an answer here:

https://forum.solidworks.com/thread/64245

 

1 Like

Thank you .PL

The code I adapted into VB.net looks like this:

Dim swModel As SldWorks. ModelDoc2 = swApp.ActiveDoc
Dim swDim As SldWorks.Dimension = swModel.Parameter("NutThickness@Sketch1")
If Not swDim Is Nothing Then
    MsgBox("NutThickness@Sketch1 Find")
Else
    MsgBox("NutThickness@Sketch1 Not Find")
End If
1 Like