Hi,
I'm new to API programmming. I want to write a program in Visual Basic that will change a parameter within TopSolid.
I've written the following code, and the first part of the program works, i.e, I can create a new parameter "rad" and it appears in the "Edit List". However, when I try to change the parameter using the "SetConvertedValue" command I get and error - "' Get Compile error Expected:=". Any body got any ideas as to what the problem is? Also is there any API training material available?
Thanks,
Bill
-----
Private Sub Form_Load()
Dim TopDoc3D As TopSolid.Document
Dim TopParam As TopSolid.Parameter
Dim strName As String
Dim paramValue As Double
Set TopApp = New TopSolid.Application
Set TopDoc3D = TopApp.CurrentDocument ' TopDoc3D is the current file - Note File needs to be open
TopApp.Visible = True ' Show TopSolid if it is minimised
'create parameter
paramValue = 70
strName = "rad"
Set TopParam = TopDoc3D.Params.AddBasic(paramValue, "mm")
' set name to param
TopParam.Element.Name = strName ' rad = 30 appears in Edit list after this command
' to modify the value the parameter.
TopParam.SetConvertedValue(25, "mm")
' Get Compile error Expected:=
End Sub
--------------------------------[/b]
TopSolid API - Changing a parameter
Moderators: remi77, jacs, Daniel
-
- Private
- Posts: 2
- Joined: Wed May 19, 2010 7:11 pm
-
- Private
- Posts: 2
- Joined: Wed May 19, 2010 7:11 pm
Changing parmeter using API
I worked out the problem with my previous post in relation to changing the value of a paramter using an API.
A Dim statement for "TopSolid.Element" needs to be included at the start of the program before the use of the “SearchElementByName(strName)â€
A Dim statement for "TopSolid.Element" needs to be included at the start of the program before the use of the “SearchElementByName(strName)â€