Hello I want to print 'ModelFiles of newly created Test in ADE-XL, the printing have to be done during the Test creation.
I have following routine:
(axlSessionRegisterCreationCallback 'test_procedure1)(defun test_procedure1 (session_name) let(() (axlSessionConnect session_name "createdTest" 'test_procedure2)
);let);defunprocedure(test_procedure2(active_session active_test_name) let((oSession modelList testSession) oSession = asiGetCurrentSession() println(oSession)
modelList = asiGetModelLibSelectionList( oSession ) printf("\tModel list print 1 = %L\n" modelList)
modelList = asiGetEnvOptionVal( oSession 'modelFiles ) printf("\tModel list print 2 = %L\n" modelList) testSession = axlGetToolSession(active_session active_test_name)
oSession = sevEnvironment(testSession) modelList = asiGetModelLibSelectionList( oSession ) printf("\tModel list print 3 = %L\n" modelList)
It is strange that the routine actually prints the 'ModelFiles of the last already existing test in the ADE-XL session.
Can you say what is wrong in my script?
I'm not sure what you're trying to do here, The issue is that the test is created as soon as you've picked the design for the testbench - and at that stage the "asi" session has not been created yet (which is why the last approach doesn't work). The asiGet CurrentSession is just telling you whichever session was previously current - so that's not going to tell you anything about the newly created test.
You might be better off using the "updatedTest" signal (and then using the axlGetToolSession/sevEnvironment approach, checking that you get non-nil for each of them before trying to get the model info.
In reply to Andrew Beckett:
Thanks for the response, the proposed approach works.