How to create a coordinate system that specifies the direction of a specific axis?

Member Posts: 27
10 Comments Name Dropper
**

Hi

My need is create a coordinate system which perpendicular to the chair back(the two faces selected on the picture).

The most usual way to create the coordinate system what I want by ACT script like below.
Then I got a cooridinate system which is perpendicular to some plane face.

  1. #region Context Menu Action
  2. coordinate_systems_18 = Model.CoordinateSystems
  3. coordinate_system_106 = coordinate_systems_18.AddCoordinateSystem()
  4. #endregion
  5.  
  6. #region Details View Action
  7. selection = ExtAPI.SelectionManager.CreateSelectionInfo(SelectionTypeEnum.GeometryEntities)
  8. selection.Ids = [756]
  9. coordinate_system_106.OriginLocation = selection
  10. #endregion
  11.  
  12. #region Details View Action
  13. coordinate_system_106.PrimaryAxisDefineBy = CoordinateSystemAlignmentType.Associative
  14. #endregion
  15.  
  16. #region Details View Action
  17. selection = ExtAPI.SelectionManager.CreateSelectionInfo(SelectionTypeEnum.GeometryEntities)
  18. selection.Ids = [756]
  19. coordinate_system_106.PrimaryAxisLocation = selection
  20. #endregion

But there are some problems that the two faces are curved surface, not a plane. So I cannot get the coordinate system by the script above.

Is there any good idea for create a coordinate system which is perpendicular to the curved surface?

Comments

  • Member, Employee, GitHub-issue-creator Posts: 353
    50 Answers 100 Comments Second Anniversary 25 Likes
    ✭✭✭✭
    edited June 2024
    1. with open(r'D:\Temp\SolidMechanics.py') as f:
    2. cmds = f.read()
    3. exec(cmds)
    4.  
    5. my_cs = Model.CoordinateSystems.AddCoordinateSystem()
    6. RotCS(my_cs,[[0,0,1],[1,0,0],[0,1,0]])
  • Member, Employee, GitHub-issue-creator Posts: 353
    50 Answers 100 Comments Second Anniversary 25 Likes
    ✭✭✭✭

    @Jimmy He Did you publish your coordinate system toolkit?

Welcome!

It looks like you're new here. Sign in or register to get started.