cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Need help navigating or using the PTC Community? Contact the community team. X

Script Output to a vector

NedMoran
2-Guest

Script Output to a vector

Hello All,

I am new to this community and have a question regarding script output to a vector. I have searched existing discussions and cannot seem to find exactly what I want.

I have a worksheet containing a `list box` of steel sections and wish to output the properties of a selected section into a vector. A `list box` will only allow four outputs and I require seven, hence the vector. So I only have one output, into a vector of seven elements - but I can't for the life of me work out what the line of script should contain to do this. The vector is called `Props` and contains the seven elements.

This is the line I am trying to use -

Outputs(1).Value = Worksheet.getvalue("Matl").GetElement(Sel,5)

My question is, what do I need to add to the line to get it to put the appropriate value into the Props vector?

Many thanks,

Regards Ned

5 REPLIES 5
MikeArmstrong
5-Regular Member
(To:NedMoran)

Hi Neil,

Sorry for the late reply, I have been away with work.

Yes, this can be done. Can you provide a worksheet to work with please?

Mike

Thanks for your input Mike,

Since I posted my question and after much trial and error I have managed to find the solution myself. This turned out to be very simple in the end, but is never obvious when first confronted with it.

Outputs(1).Value (n) = Worksheet.getValue ("Matl") -------------------------- etc. Where `n` = the nth row of the vector - how simple is that?

Regards Ned

RichardJ
19-Tanzanite
(To:NedMoran)

There are a lot of example scripts here:

Extra Components.mcd

Richard,

Many thanks, I will study these examples carefully, they look very helpful.

Ned

MikeArmstrong
5-Regular Member
(To:NedMoran)

Outputs(1).Value (n) = Worksheet.getValue ("Matl") -------------------------- etc. Where `n` = the nth row of the vector - how simple is that?

Yes, it is relatively simple, when you know how

Mike

Top Tags