×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

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

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

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

(OP)
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

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources