Dear STKO team,
can I show the coordiates of existing points? and how can I see them?
Thanks
Showing the coordinates of points
Re: Showing the coordinates of points
In pre or post processor?
ID of vertices (geometry) or nodes (mesh)?
ID of vertices (geometry) or nodes (mesh)?
-
marafini.f
- Posts: 363
- Joined: Fri Nov 13, 2020 1:52 pm
Re: Showing the coordinates of points
Hi BuuNguyen,
if you want to just see them, you can just hover on one of the points you can see its coordinates in the bottom left corner of the preprocessor.
If you want to extract them, you can use the python API. For example, you can use the following code to extract the coordinates of points in a specific selection set, in a specific direction.
Let me know if you need something else.
Enjoy your mdoeling
Francesca
if you want to just see them, you can just hover on one of the points you can see its coordinates in the bottom left corner of the preprocessor.
If you want to extract them, you can use the python API. For example, you can use the following code to extract the coordinates of points in a specific selection set, in a specific direction.
Code: Select all
from PyMpc import *
doc = App.caeDocument()
doc.scene.unselectAll()
def printCoordVertInSS (sid,dir):
#take the selection Set
sset = doc.getSelectionSet(sid)
#if there is no selection set with that ID, raise an exception
if sset is None:
raise Exception("Cannot find selection set {}".format(sid))
#create an empty dictionary to save all the positions or the positions
positions = {}
dirpos = {}
for geom_id, sset_item in sset.geometries.items():
if sset_item.wholeGeometry:
continue
geom = doc.getGeometry(geom_id)
if geom:
for i in sset_item.vertices:
positions[i] = geom.shape.vertexPosition(i)
for _,pos in positions.items():
dirpos[i] =pos[dir]
return print(dirpos)
printCoordVertInSS(2,1)
Enjoy your mdoeling
Francesca
Re: Showing the coordinates of points
thank you for your quick reply.
Do you have a link that gives information about PyMpc library?
As Numpy, mathplotlib have some websites to show syntaxes in their library.
Do you have a link that gives information about PyMpc library?
As Numpy, mathplotlib have some websites to show syntaxes in their library.
Re: Showing the coordinates of points
Dear BuuNguyen,
Here is a link to the PyMpc documentation Wiki: https://asdeasoft.net/stko-wiki/
It is still a work in progress but it contains helpful information.

Here is a link to the PyMpc documentation Wiki: https://asdeasoft.net/stko-wiki/
It is still a work in progress but it contains helpful information.