Get Centroid or coordinates of Remote points

Lukas
Lukas Member Posts: 11
Name Dropper First Comment
edited June 2023 in Structures

Hello,

I automatize join connections in my assembly. I wrote a script to create remote points on each of components. Now I would like to measure the distance between the remote points and identify corresponding pairs. However I have not found any property of Remote point giving me its centroid or coordinates. Do you have any idea how to get this property?

Thank you

Regards

Lukas

Answers

  • Lukas
    Lukas Member Posts: 11
    Name Dropper First Comment

    okey seems to be trivial

    ie. RemotePoint.XCoordinate

    RemotePoint.Location



    It´s really strange that tooltip in console shows much more options as tooltip in ACT editor...

  • Mike.Thompson
    Mike.Thompson Member, Employee Posts: 240
    First Anniversary First Comment 5 Likes Ansys Employee
    edited January 2023

    For remote points there is no centroid as they are a point. You have seen this directly that there is XYZ coordinates that can be taken as is for the point location.

    That said, RPs can be located anywhere, regardless of the connection to the model. By default they are located at the centroid of the scoping, but that is an assumption and can be changed. You would need to look at the scoping entities and calculated the weighted centroid of the geometry/mesh entities to get the centroid point of the scoping. Getting the centroid of GeoEntities and/or Elements is possible, so this is just a simple calculation to get the weighted centroid of multiple entities.

  • Lukas
    Lukas Member Posts: 11
    Name Dropper First Comment

    thanks @Mike.Thompson. I figured that out in the meantime .Clear, in this case it migh be only coordinate/location. What was also supprising for is the fact that although I have 8 remote points and use "Model.RemotePoints.Children" and print its length, it´s equal to 9. When I check their IDs, there is one number far away from others. I suspect it´s parent (Remote point category in tree), but I did not get why it´s in the list when I call Children.

  • Mike.Thompson
    Mike.Thompson Member, Employee Posts: 240
    First Anniversary First Comment 5 Likes Ansys Employee

    There are other objects in the tree, for example joints, beams, moments etc... that use remote points in the background. They do not show up in the tree, but they are children of the remote point object as you have seen. There is a property of the remote point (something like 'visible' but I can't recall...) that will distinguish between the remote points seen in the tree vs. ones that are background remote points.

    Another way to avoid this happening is to use scoping directly to remote points in these objects and thus only remote points visible in the tree are used.

  • Lukas
    Lukas Member Posts: 11
    Name Dropper First Comment

    @Mike.Thompson I have one more observation. After creating remote points I basically measure distance between their locations and create pairs for joint connection. However I see that the distance is not calculated properly and I´ve found why. I would assume the location of remote point scoped to the edges of the hexagonal hole is just center of the hole, but it´s not the case. Remote points are scoped properly, but when I check their properties in GUI, they have all the same X,Y,Z coordinate. How to force mechanical to assign a proper location? Do I have to do it manually. I.e. from the coordinates of the edges to calculate the center?

    This is how I proceeded originaly. "edge_group" is basicaly list of lists. Each of nested list consists of edge Ids for given hexagonal hole. As a result, I get remote point for each hexagonal hole:

    #Create remote points

    for i in range(len(edge_group)):

      remote_points = Model.RemotePoints

      remote_point = remote_points.AddRemotePoint()

      selection = ExtAPI.SelectionManager.CreateSelectionInfo(SelectionTypeEnum.GeometryEntities)

      selection.Ids = edge_group[i]

      remote_point.Location = selection

      ExtAPI.SelectionManager.ClearSelection()


    Thank you