DrBwts
Mechanical
- Nov 4, 2012
- 297
Why would a script when entered on the command line work but not when its run from a file?
I enter the following at the command line..
Just cut & paste & it works I get list of the element labels under 'Surf-1'.
BUT if I run the following script...
surfEl is empty!?!
What's all that about?
For some reason the for loop is never entered.
I enter the following at the command line..
Python:
mySurf = mdb.models['Model-1'].rootAssembly.surfaces['Surf-1']
surfEls = []
for eLab in mySurf.elements:
surfEls.append(eLab.label)
print surfEls
Just cut & paste & it works I get list of the element labels under 'Surf-1'.
BUT if I run the following script...
Python:
from part import *
from material import *
from section import *
from assembly import *
from step import *
from interaction import *
from load import *
from mesh import *
from optimization import *
from job import *
from sketch import *
from visualization import *
from connectorBehavior import *
mySurf = mdb.models['Model-1'].rootAssembly.surfaces['Surf-1']
surfEls = []
for eLab in mySurf.elements:
surfEls.append(eLab.label)
print surfEl
surfEl is empty!?!
What's all that about?
For some reason the for loop is never entered.