hexagon logo

Does someone have python-Adams examples

Hey guys,
 
I am looking into using python scripts in Adams instead of the command language.
So far I have found 2 examples scripts in the 'adamspy' folder and the help function also provides some examples and classes definitions. However, i feel like i am missing examples to problem solve things i encounter. Does anyone know where i could find more examples?
 
As an problem example; i got this simple script that creates 2 markers, and should parametrize one marker to the other marker. However, the location of the marker isn't updated. Do i need to call an mod.update() or something?
 
python script
marker not updated
Thanks in Advance!
Parents
  • Hi Niels,
     
    I just tried your code and it worked as expected for me. I suspect that you expect to see the marker moved by quite a large amount, but perhaps your units are small (millimetre?) so it doesn't look like the marker actually moved. I put in a larger number for the offset {100, 100, 0} and I can clearly see:
    • the parameterized marker is offset from the referenced marker,
    • the expression is proper (as you have shown in your image, which makes me think that your model is correct?)
    • I can move the reference marker and the slave marker moves properly.
     
    So I think that your code is correct. I do recall in a certain version of the code that you could run into an issue with the graphics not updating properly, so *perhaps* that is happening here, but I wonder if the 'delta' that you have used is simply too small to notice when you look at the model quickly?
     
    Hope this helps,
    Kent
     
Reply
  • Hi Niels,
     
    I just tried your code and it worked as expected for me. I suspect that you expect to see the marker moved by quite a large amount, but perhaps your units are small (millimetre?) so it doesn't look like the marker actually moved. I put in a larger number for the offset {100, 100, 0} and I can clearly see:
    • the parameterized marker is offset from the referenced marker,
    • the expression is proper (as you have shown in your image, which makes me think that your model is correct?)
    • I can move the reference marker and the slave marker moves properly.
     
    So I think that your code is correct. I do recall in a certain version of the code that you could run into an issue with the graphics not updating properly, so *perhaps* that is happening here, but I wonder if the 'delta' that you have used is simply too small to notice when you look at the model quickly?
     
    Hope this helps,
    Kent
     
Children
No Data