TAGGED: scripting, spaceclaim
-
-
March 16, 2022 at 6:16 am
Guillaume ANFOSSI
Subscriberš This post originally contained file attachments which have been removed in compliance with the updated Ansys Learning Forum Terms & Conditions
Hello,
I have a part positioning problem when creating geometry with scripting in the context of assembly.
If I create the geometry directly at the root, it's ok.
But if the solid is created in the component, I get a positionning offset.Should i useĀ TransformToMaster command ? How it works ?
Thanks,
-
March 16, 2022 at 6:57 am
Devendra Badgujar
Ansys EmployeeHiĀ GUICAD
Let me check and get back to you.
-
March 16, 2022 at 1:54 pm
Devendra Badgujar
Ansys EmployeeHiĀ GUICAD
Here is what you need to add at the end.
transform body
Python
newBody=DesignBody.Create(mypart,"circle",mycircle) mycomp=GetRootPart().Components[1] mycompFrame=mycomp.GetAllCoordinateSystems()[0].FramemycompMatrix=Matrix.CreateMapping(mycompFrame) newBody.Transform(mycompMatrix.Inverse)
It looks at the component the new body is going into to get the local coordinate system, then it creates a matrix mapping and uses the inverse to transform the body.
Please let me know if you need any further assistance on this.
Regards.
-
March 17, 2022 at 9:38 am
Guillaume ANFOSSI
SubscriberGreat ! Thanks
-
- 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.

Ansys Blog
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.
-
3862
-
2629
-
1859
-
1252
-
600
Ā© 2023 Copyright ANSYS, Inc. All rights reserved.