Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations The Obturator on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Python findAT(...) command: problems passing multiple arguments as a variable

Status
Not open for further replies.

mbweller

Geotechnical
May 30, 2013
1
Hi all,

I have an interesting issue with the findAt command.

I'm trying to select 2*m number of edges (both left and right) in a python script:

# Ld are the layer points
Lpts=[]
m=0
for m in range(len(Ld)-1):
Lpts.append(((max(side), (Ld[m]+(Ld[m+1]-Ld[m])/2), 0),),)
Lpts.append(((min(side), (Ld[m]+(Ld[m+1]-Ld[m])/4), 0),),)



Which creates a list of 2*m end points, the problem occurs with findAt:

inst.Surface(name='Surf-2', side1Edges= inst.instances['ThreeLayers-1'].edges.findAt(Lpts))
which returns -->
TypeError: arg1; too many arguments; expected 1, got m


however, if I print, then copy and past (without the brackets) the layer points into the above findAt, it works. I've tried converting the list to a tuple, but that fails as well

There seems to be a syntax problem when I pass the variable to findAt, but not for when I copy and paste. For the life of me, I can't seem to figure out what the problem is.

Any help would be appreciated!

Thanks,

~Matt
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor