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

Community Tip - Learn all about the Community Ranking System, a fun gamification element of the PTC Community. X

How to extract an element that has been defined as a range from a vector?

Cornel
19-Tanzanite

How to extract an element that has been defined as a range from a vector?

Hello,

How to extract for example the 13th element from below?

Cornel_0-1695736939181.png

Cornel_1-1695736945839.png

Cornel_2-1695736952911.png

Cornel_3-1695737002942.png

Cornel_5-1695737095494.png

 

Cornel_0-1695737359209.png

ACCEPTED SOLUTION

Accepted Solutions

Hi,

The creation of x makes it a range variable not a vector of scalars.  An undocumented trick to turn the range into a scalar vector is to use inline equals in the definition.

Capture.JPG

View solution in original post

4 REPLIES 4

Hi,

The creation of x makes it a range variable not a vector of scalars.  An undocumented trick to turn the range into a scalar vector is to use inline equals in the definition.

Capture.JPG

I have a question here: can this undocumented trick fail? And if yes, then when can it fail?

Never had the trick fail.  Here is the "correct" way

Capture2.JPG

LucMeekes
23-Emerald III
(To:Cornel)

It will fail if PTC at some point, in a later version of Prime, makes it impossible or unusable.

So far that hasn't happened, but there's so much that hasn't happened with, or by, PTC over the past more than 10 years.... the chance that things will happen can only grow over time.

 

Success!
Luc

Announcements

Top Tags