×
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

Python - findAt(...) command

Python - findAt(...) command

(OP)
Hi,

just in few steps (python drives me crazy again clown ):

>>> selEdges = pEdge.findAt(( (rightEnlPartPoint, leftEnlPartPoint, centerTopRLEdgePoint), ))
>>> thePartEau.seedEdgeBySize(edges=selEdges, size=seedSizeEau/dense_mesh)

errormessages for seedEdgeBySize:
1) found None, expecting tuple - so I enetered a tuple:
>>> thePartEau.seedEdgeBySize(edges=(selEdges,), size=seedSizeEau/dense_mesh)
2) found tuple, expecting Vertex

Everything, which precedes these lines works without any problem. I didn't find any "specialized definition" for Vertex in the case mentioned (edges are obviously required for the used function). I really need a help, please, because I have been stucked on such lines many times, many hours, since started using the python, without finding any useful info in the manual...

Any solution?

RE: Python - findAt(...) command

Some remarks:
-1. In this line pEdge.findAt(( (rightEnlPartPoint, leftEnlPartPoint, centerTopRLEdgePoint), )), I think you have an extra "()".
0. I assume pEdge is an EdgeArray object and not an Edge object.
1. You should check that selEdges contains something and it is not None.
2. rightEnlPartPoint, leftEnlPartPoint, centerTopRLEdgePoint must be 3D points , i.e. each must be in format (X,Y,Z)
3. the edges in selEdges should belong to thePartEau
4. You can try to supply one point at a time in .findAt(...) and see if there's a problem only with one of them.
5. you can try something like this:
thePartEau.seedEdgeBySize(edges=thePartEau.edges.findAt((rightEnlPartPoint, leftEnlPartPoint, centerTopRLEdgePoint)), size=seedSizeEau/dense_mesh)
6.good luck ! smile

RE: Python - findAt(...) command

(OP)
xerf:
-1. if I delete the extra (), I would get a message, that GeomSequence found, expecting I don't know what now...
0. pEdge is defined as "part".edges
1. I have did the check, there was really None in it - I also checked, what findAt does after each step and I found out, that if I have used 2 arguments, it still uses just the first one...
2. each point is in format (x, y, z) - each coordinate is such a composition of other variables, so I defined them before
3. the edges belong to the right part
4., 5., 6. I solved it now, but it's really awful:

>>> selEdges = (pEdge.findAt(( rightEnlPartPoint,)) + pEdge.findAt(( leftEnlPartPoint,)) +
            pEdge.findAt(( centerTopRLEdgePoint,)) + pEdge.findAt(( topRightEnlPartPoint,)) +
            pEdge.findAt(( topLeftEnlPartPoint,)))
>>> thePartEau.seedEdgeBySize(edges=selEdges, size=seedSizeEau/dense_mesh)

I didn't find any other way, how to make it working, when the syntax in manual doesn't work ;o) Thanks for your suggestions.

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