Skip to main content
Solved

API system parameter tracking


redbottle

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!!

Best answer by David.Nguyen

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

View original
Did this topic help you find an answer to your question?

2 replies

David.Nguyen
Luminary
Forum|alt.badge.img+2
  • Luminary
  • 1112 replies
  • Answer
  • August 11, 2022

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


redbottle
  • Author
  • Monochrome
  • 4 replies
  • August 11, 2022

Thank you David! It works!


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings