Dear STKO Support Team,
I would like to ask about how to reload the work tree items.
For example, if I create Analysis Steps using PyMpc as follows:
# Main Analysis
meta = doc.metaDataAnalysisStep('Analyses.AnalysesCommand')
xobj = MpcXObject.createInstanceOf(meta)
xobj.getAttribute('analysisType').string = 'Transient'
xobj.getAttribute('constraints').string = 'Transformation Method'
xobj.getAttribute('algorithm').string = 'Krylov-Newton'
xobj.getAttribute('transientIntegrators').string = 'TRBDF2'
xobj.getAttribute('numIncr').integer = 1000
xobj.getAttribute('duration/transient').real = 1
anly = MpcAnalysisStep()
anly.id = 41
anly.name = 'Main analysis'
anly.XObject = xobj
doc.addAnalysisStep(anly)
I already have set the 'analysisType' as 'Transient', but in STKO there are still 'staticIntegrators (load control)' activated.
So, when I run the analysis it doesn't run as transientIntegrator "TRBDF2".
And I found that I need to manually set the 'analysisType' from 'static' to 'transient' again for the 'staticIntegrators' to disappear and the 'transientIntegrators' to appear.
Is there any way to handle this problem?
Thank you,
CJH
Reload the Work Tree items
Re: Reload the Work Tree items
Once you modify the Xobject and set it to the AnalsyisStep (or any other object, like Physical Property, Conditions, etc..), call the commitXObjectChanges method:
It performs some operation in the background, as hiding/showing some attributes based on other attribute values
Code: Select all
anly.XObject = xobj
anly.commitXObjectChanges()