-
-
August 8, 2023 at 1:46 pm
Jake Garrison
SubscriberHello,
How can I pin an axis via SpaceClaim scripting that I created through the center of a circle?
# Create Datum Line
selection = EdgeSelection.Create(GetRootPart().Bodies[0].Edges[462])
result = DatumLineCreator.Create(selection, False, None)# check if the datum line is pinned or not
GetRootPart().DatumLines[0].PinnedI would like to set the value of Pinned to True or False.
Thanks.
-
August 10, 2023 at 12:29 am
mjmiddle
Ansys EmployeeThere is no published API for this. You have to do it through a call to the GUI command. Unfortunately, the recorded commands that create a datum line won't associate the datum with the selected edge, so it can't be pinned. So you also have to use a GUI command to create the datum line.
from SpaceClaim.Api.V23 import Command
selection = EdgeSelection.Create(GetRootPart().Bodies[0].Edges[462])
selection.SetActive()
Command.GetCommand("CreateDatumLine").Execute() # the axis created will automatically be selected
Command.GetCommand("PinDatum").Execute() -
August 10, 2023 at 1:22 pm
Jake Garrison
Subscribermjmiddle,
When I attempt to run "Command.GetCommand("CreateDatumLine").Execute()" in the interpreter I get the error "name 'Command' is not defined".
-
August 10, 2023 at 5:32 pm
mjmiddle
Ansys EmployeeThe first line will import the command. You are probably using too old a version if it does not work. What version are you using? Maybe the datum line creation is a different command in your version.
-
August 10, 2023 at 6:06 pm
Jake Garrison
SubscriberI'm using 2023 R1, I will try again using 2023 R2 after importing Command.
-
August 10, 2023 at 6:10 pm
mjmiddle
Ansys EmployeeYou need to change the V23 in the first line to match your version.
-
August 11, 2023 at 4:08 am
mjmiddle
Ansys EmployeeI ran the script in 2023 R1 exactly as I printed it, and it worked. If it gives an error that "Command" is not defined, that would indicate the first line to import it was not run. If the first line was run and the Command object was not found, the first line would produce an error.
-
- 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.
- How to work with STL file?
- Rotate tool in ANSYS Design Modeler
- section plane
- Using Symmetry in DesignModeler and Expanding the Results
- ANSYS FLUENT – Operation would result in non manifold bodies
- drawing a geometry by importing a table of points
- material properties
- Coordinates orientation
- “contact pair has no element in it.” how to resolve this problem
- Parameters not imported into Workbench 18.2 from Solidworks/Inventor
-
7592
-
4440
-
2953
-
1427
-
1322
© 2023 Copyright ANSYS, Inc. All rights reserved.