Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Need to extract only Center of Gravity Data not Inertia of CG. #54

Open
VivekPatil007 opened this issue Sep 13, 2022 · 3 comments
Open

Comments

@VivekPatil007
Copy link

Hello All,

I'm using Creoson for automating the data extraction from creo using python.
I need to extract mass property especially Center of Gravity but "file_massprops" is not able to get it.

Currently, it gets,
"volume, mass, density, surface area ,ctr_grav_inertia_tensor, coord_sys_inertia, coord_sys_inertia_tensor"

Does anyone have any idea how can I get the Center of Gravity..?

Thanks In Advance 😃

@VivekPatil007 VivekPatil007 changed the title How to get Center of Gravity Data from Mass Property How to get Center of Gravity Data Sep 13, 2022
@VivekPatil007 VivekPatil007 changed the title How to get Center of Gravity Data How to get Center of Gravity Data.? Sep 13, 2022
@VivekPatil007 VivekPatil007 changed the title How to get Center of Gravity Data.? Need to extract only Center of Gravity Data not Inertia of CG. Sep 13, 2022
@Zepmanbc
Copy link
Owner

Hi @VivekPatil007
It seems you need the BMX module to get the COG, to create the CSYS_COG and get its coordinates...
https://community.ptc.com/t5/3D-Part-Assembly-Design/Centre-of-Gravity-CG-for-parts-assemblies-and-drawings-to-be/td-p/318753
but maybe I'm wrong, if anyone knows?

I see a hard way to get it if you do a mapkey that open the mass property window, compute the properties, copy the result to clipboard, close the window.
Then you can get the result from clipboard with something like this:
subprocess.getoutput("powershell.exe -Command Get-Clipboard")
and then analyse the result string
Yes, this is the hard way

@VivekPatil007
Copy link
Author

Hello @Zepmanbc
Thank You for your reply.

Is it possible to send two commands simultaneously to Creo using the Creoson server..?

if not then how I can send the mapkey to Creo from python without using hotkeys... any idea..?

I have tried to run c.file_assemble( ) & c.interface_mapkey(' ') commands, but at a time only one command is executing.

@Zepmanbc
Copy link
Owner

You record your mapkey, get the source and use it with interface_mapkey
You cannot send simultaneous command to Creoson

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants