CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   ANSA (https://www.cfd-online.com/Forums/ansa/)
-   -   Create 3dpoints on selected face (https://www.cfd-online.com/Forums/ansa/226350-create-3dpoints-selected-face.html)

shubham04 April 24, 2020 09:59

Create 3dpoints on selected face
 
Hello Everyone,

I want to create a 3dpoints on selected face. I tried to select the face but not able to create the 3d points on it. Purpose of this script is to measure the thickness at particular location. if anyone knows the solution please help me:)

def main():
types = ['FACE']
entity = base.SelectEntitiesList(deck, types)
print('Selected entity ', entity._id)


Thanks and Regards,
Shubham

shubham04 April 27, 2020 06:45

If any one knows answer, Please reply

rmaries April 28, 2020 03:53

do you have another point to project on the surface.? Surface is big area. At which point in the surface do you want to create point. Need one more input.

shubham04 April 29, 2020 06:31

I don't want to project the existing point, but just like 'Weld Spot' function i want to create a points on a face. But i am not able to create the co ordinates of that points, just by clicking on face.


def main():
face = base.GetEntity(base.CurrentDeck(), 'FACE', 63046)
coords = []
coords.append([2688.54, -353.579, 13.3602])
coords.append([2724.17, -331.047, 13.1536])
coords.append([2779.36, -313.861, 12.4984])
coords.append([2833.71, -323.72, 11.4548])
coords.append([2851.94, -338.252, 11.0163])
coords.append([2861.41, -347.123, 10.7709])
ret = base.HotPointsWeldSpot(face, coords, False, True)
print(ret)


Thank you.

rmaries April 29, 2020 07:10

Use True for produce3dpoint parameter like below. It is working.

base.HotPointsWeldSpot(face, coords, True, True)


It was clearly mentioned in the help where you copied the above example.
ansa.base.HotPointsWeldSpot(face, coordinates, produce3dpoint, ret_ents)

shubham04 May 7, 2020 00:31

Thank you for your reply,

now my next concern is how to get the coordinates of projected points on surface, I had tried this but not working. I dont know how to use base.Entity function


def main():

# Selects faces and create points

ent_types = ("FACE")
entities1 = base.PickEntities(deck, ent_types)
print((entities1))

types = ['FACE']
entity = base.SelectEntitiesList(deck, types)
print('Selected entity ', entity._id)
face = base.GetEntity(deck,'FACE',entity._id)
print(face)

all_coordinates = base.PickPointOnSurface(entities1)

print(all_coordinates)
print(type(all_coordinates))


base.HotPointsWeldSpot(face, all_coordinates, True, True)

#Project the points

ent_types = ("FACE")
entities2 = base.PickEntities(deck, ent_types)

projected_points = []
for coordinates in all_coordinates:
projected_points.append(base.HotPointsProject(coor dinates[0],coordinates[1], coordinates[2], entities2))
base.All()
print(projected_points)

collect_point = []
for coordinates2 in projected_points:
collect_point.append(base.Entity(deck,coordinates2 ._id,'HOT POINTs','position'))
print(collect_point)

shubham04 May 9, 2020 06:44

If any one having answer to this please reply.

Thank you


All times are GMT -4. The time now is 22:50.