Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

VBA Macro in Microwave Studio

Status
Not open for further replies.

kato01

Full Member level 2
Joined
Dec 2, 2002
Messages
123
Helped
6
Reputation
12
Reaction score
3
Trophy points
1,298
Activity points
831
expecting an already dimensioned array

Hello,
I have some problems understanding the correct syntax of some of the methods :
This is the "cut & paste" from the HELP:
<<GetNumberOfVaryingParameters long
Returns the number of varying parameters.>>

1. I took all the history and turned it into a macro.
2. I would like to write in a file a summary of the project (no. of parameters, values etc, so I need to extract the values of the parameters using the appropriate VBA methods.
3. This is what I have:

Dim VNAME(10),VVALUE(10) As Long
Dim VNAME(10) As String
Dim NVAR As Integer
Dim VVALUE(10) Double
Dim i As Integer
NVAR=GetNumberOfVaryingParameters
For i=1 To 10
VNAME(i)=GetNameOfVaryingParameter(i) ‘line (*)
VVALUE(i)=GetValueOfVaryingParameter(i)
Next i

It does not work!

1. The macro does not run and @ line(*) I get the following message:
<<Expecting an already dimensioned array (VNAME(i)=GetNameOfVaryingParameter(i))>>

2. if I eliminate the (*) line AND the next one, the macro DOES run but I get NVAR=0% (I have 12 parameters)

Any ideas?

Thanks

Kato
 

ctime expecting an already dimensioned array

If I can guess correctly, you are trying to find the total number of parameters that you have defined in your project. Actually this number is returned by GetNumbreOfParameters and not GetNumberOfVaryingParameters...

VaryingParameters are the ones that have been defined in the ParametricSweep option of the Transient Solver (if any)... Probably you haven't defined a sweep that's why the NVAR returns 0.

Hope this helps...
mogwai.
 

microwave studio vba

Thanks, that obviously makes sense!
 

Hello everyone, I have have problem. I am trying to get x a y values in Mix0D results in CST Design Studio. I can easily get x values. Here is the code
Dim x As Double, y As Double
Dim a As Boolean
Dim sarray(1000) As String, varray(1000) As String
Dim objName1 As Object

Set res = CreateObject("CSTStudio.DSTable")
res.Load("path to Mix0D.tab")
y = GetNumberOfParameters
k = res.GetParameterNameFromIndex(0)
With res
iV = .GetVaryingParameter
nData = .GetNumberOfDataItems
For iData=0 To nData-1
sarray(iData) = sarray(iData) + CStr(.GetParameterValueOfDataItem(iData,iV))
y = .Get0DDataItem(iData) 'here is error => unknown data type of y values
Next iData
End With

Added after 48 seconds:

Can anybody help me how to get y values from Mix0D table
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top