Solved

API system parameter tracking

  • 11 August 2022
  • 2 replies
  • 38 views

Hi 
I am trying to track the x, y coordinates using API. I know in Macros I would just use the following: 

SYSP 102, 1, x

SYSP 103, 1, y

anyone know how to pull these coordinates using API (Matlab) ? 

Thanks!!

icon

Best answer by David.Nguyen 11 August 2022, 11:04

View original

2 replies

Userlevel 7
Badge +2

Hi redbottle,

 

The literal translation in Python would be:

# Define field number to be modified
FieldNumber = 1

# New field coordinates
Hx = 1.23
Hy = 2.34

# Retrieve corresponding field data
MyField = TheSystem.SystemData.Fields.GetField(FieldNumber)

# Update field coordinates
MyField.X = Hx
MyField.Y = Hy

I imagine this is the same in MATLAB. The variable Hx and Hy correspond to your variables x and y.

Let me know if this works for you.

Take care,

 

David

Thank you David! It works!

Reply