VarianAPIs / Varian-Code-Samples

Code samples for ESAPI and other Varian APIs and web services.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Setting rangeshifter and snout position for ion beams

MaikenGuldberg opened this issue · comments

I am making a script to enable the user to quickly set the rangeshifter and snout position for multiple ionbeams at once. My problem is that i try to set the rangeshifter by modifying the PreSelectedRangeShifter1Id property on the IonBeamParameters object (got that by using GetEditableParameters() on the field). It does add a new range shifter when there are not already added one, but if i try to change the current one the problem seen in figure 1 occurs. I get the error seen in figure 2, when trying to calculated afterwards.

range shifter error figure 1
Figure 1
range shifter error figure 2
Figure 2

My other problem is that i can not change the snout position for the ionbeam. I have tried to set the snoutpos on the ControlPoints parameter on the IonBeamParameters object, but it does not seems to change the snout position found in the properties for the ionbeam, when i try to investigate it after using the script. I also tried to set the snout position by changing it on the StartControlPoint and EndControlPoint of every item in the IonControlPointPairs list (property on the IonBeamParameters object), but that did not seem to help either.. any clues on how to get it working? I did use ApplyParameters after editing the IonBeamParameters.

As i have invastigated it is not posible to directly set the airgap (it does not have a set method), but can it be done any other way? Is there a way to calculate the airgap without recalculating the whole plan again? (i want to show the user what the airgap is going to be when they change the snout position)