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

Community Tip - New to the community? Learn how to post a question and get help from PTC and industry experts! X

Translate the entire conversation x

Error in getting the last index number

fahmed-2
14-Alexandrite

Error in getting the last index number

Hello,

 

I am trying to get the last index number of  a rangr but am unable. Please help. My version is Prime 10.0.1.0

 

fahmed2_0-1754678074080.png

Thank you

 

3 REPLIES 3
Werner_E
25-Diamond I
(To:fahmed-2)

You are confusing a range variable (sort of implicit loop) with a vector (a collection of individual values).

Indices and "last" elements exist only for vectors. But the variables S and B you defined are ranges and in Prime 10 and above also s and b remain being ranges!

 

Are you trying to redo what someone else did in an older version of Prime? In versions of Prime up to V9 an inline evaluation as seen in your picture converted a range into a vector. In Prime 10 and above this does not work anymore.

I also don't see any need for the definition of the variables S and B or s and b.

Simply use  Q:=CreateMesh(q3D,1,3,1.2,5,21,20) to get the same result.

 

If you really need to convert the ranges S and B to vectors s and b you may use the small utility function range2vec which was posted here in the forum a couple of time. Starting with version 11 of Prime you should rather use the new built-in function "vec".

See for example Re: This value must be a vector in MPC10

 

Here in more detail:

Werner_E_1-1754687952393.png

Werner_E_2-1754688188513.png

 

Prime 10 sheet attached

 

It is the old range is not a vector and visa-versa issue.

si and bi are index ranges, s and b are vectors.

Capture.JPG

Hi @fahmed-2,

 

I wanted to see if you got the help you needed.

If so, please mark the appropriate reply as the Accepted Solution. It will help other members who may have the same question.
Please note that industry experts also review the replies and may eventually accept one of them as solution on your behalf.
Of course, if you have more to share on your issue, please pursue the conversation. 

 

Thanks,
Anurag

Announcements

Top Tags