2016-08-19 1 views
1

getclosest 명령을 사용하여 정점을 찾습니다.Abaqus Python 'Getclosest'명령

ForceVertex1 = hatInstance.vertices.getClosest(coordinates=((x,y,z,)) 

이 키 0의 두 값 (hatInstance.vertices [1]와 꼭지점의 좌표) 특정 출력 사전 목적 : I가 세트를 만들려고 할 때마다

{0: (mdb.models['EXP-100'].rootAssembly.instances['hatInstance-100'].vertices[1], (62.5242172081597, 101.192447407436, 325.0))} 

tolerance = 1.0e-3 

     vertex = [] 
     for vertex in hatInstance.vertices: 
      x = vertex.pointOn[0][0] 
      print x 
      y = vertex.pointOn[0][1] 
      print y 
      z = vertex.pointOn[0][2] 
      print z 
      break 
      if (abs(x-xTarget)) < tolerance and abs(y-yTarget) < tolerance and abs(z-zTarget) < tolerance): 
      vertex.append(hatInstance.vertices[vertex.index:vertex.index+1]) 
: 정점이
mainAssembly.Set(vertices=ForceVertex1[0][0],name='LoadSet1') 

을 인정하지 않는 나는 또한 다른 방법을 시도

xtarget 등이 내 좌표 임에도 불구하고 나는 여전히 정점 개체를 얻지 못했습니다.

답변

1

이러한 문제에 대해 저는 해결했습니다.

매뉴얼을 권장 함에도 불구하고 사전 오브젝트를 리턴하므로 getClosest 명령을 사용하지 마십시오. 이 사전 객체, 특히 키와 독립 객체 (정점) 내의 값을 변환 할 수 없습니다.

대신 Instance.vertices.getByBoundingSphere (center =, radius =)를 사용하십시오.중심은 기본적으로 반지름은 공차입니다. 그러면 정점 배열

을 반환합니다.
관련 문제