TAGGED: scripting, spaceclaim
December 18, 2019 at 2:19 pmGuillaume ANFOSSISubscriber
I am looking to automate the part numbering according to their position in an assembly. My idea is to compare the alignement between local and global origin (X and Y). Could you help me to find the code in scripting ?
If you have another idea you're welcome
Thanks,🛈 This post originally contained file attachments which have been removed in compliance with the updated Ansys Learning Forum Terms & Conditions
December 19, 2019 at 8:28 amSubashni RavichandranAnsys Employee
I will need to consult with my team on this as I'm not an expert on scripting. I will get back to you as soon as I hear from them.
December 30, 2019 at 5:31 amSubashni RavichandranAnsys Employee
Sorry for the delay in response. As it was the holiday season I found it difficult to get hold of some help.
You can use commands such as "GetCoordinateSystems()" to access the coordinates of the local coordinate system (wrt global origin) of a component.
You can then create a loop to rename the components as per their coordinates as required.
Below is a sample script written by my colleague to print the coordinates. You can use it for your reference.
comps = part.GetAllComponents()
org = comps.GetCoordinateSystems()
x_coord = org.Frame.Origin
y_coord = org.Frame.Origin
z_coord = org.Frame.Origin
December 30, 2019 at 7:28 amGuillaume ANFOSSISubscriber
- You must be logged in to reply to this topic.
Boost Ansys Fluent Simulations with AWS
Computational Fluid Dynamics (CFD) helps engineers design products in which the flow of fluid components is a significant challenge. These different use cases often require large complex models to solve on a traditional workstation. Click here to join this event to learn how to leverage Ansys Fluids on the cloud, thanks to Ansys Gateway powered by AWS.
Earth Rescue – An Ansys Online Series
The climate crisis is here. But so is the human ingenuity to fight it. Earth Rescue reveals what visionary companies are doing today to engineer radical new ideas in the fight against climate change. Click here to watch the first episode.
Subscribe to the Ansys Blog to get great new content about the power of simulation delivered right to your email on a weekly basis. With content from Ansys experts, partners and customers you will learn about product development advances, thought leadership and trends and tips to better use Ansys tools. Sign up here.
© 2023 Copyright ANSYS, Inc. All rights reserved.