Expression to get the local variable of another node

In this case that other node is a “point” SOP. The variable I’m trying to bring into a “sphere” SOP is $NPT" - this is my fruitless attempt: point( "point1" , var("/project1/point1","NPT") , "P" , 0 )

Its wrapped within a function which is retrieving position data from a certain point.

Thanks for any help.

I’m not sure you can access the actual local variables within OPs like point and copy and such, but the number of points of any SOP can be retrieved using the tscript expression: npoints(), so in this case it would be something like npoints("/project1/point1"), you need the backticks on either side if your not writing directly into a parameter field that normally excepts numbers I believe.

Look in the help dialog for tscript and you will seem lots of other useful expressions for getting information out of sops (like nprims(), etc)

Is that what you’re looking for?

Much appreciated archo-p, spot-on.

I looked everywhere for variable-getting-expressions, not a point-number expression: De,OH!
It makes sense that $Tx/y/z or $PT are not accessible via var() since these are per-point-values; this is why point() exists. But $NPT is the “The total number of points” - and so my confusion.
I’d love to know exactly what $NPT represents - since even within the same node, its use results in a zero value.

While trying your solution I also happened on the “info” CHOP, which extracts useful hidden information about SOPs, including “num_points”. I then linked this channel to my original expression with: chop(“info1/num_points”)

Thanks again.