3D Design

3D Design

Topics related to Ansys Discovery and Ansys SpaceClaim.

Problem with Offset while scripting in Spaceclaim

    • Kurian Kuriakose
      Subscriber

      As shown in the picture below. i am unable to reference to the curve of the airfoil to create an offset. I have tried smart variable, index and ray referencing. i have also tried to make it so that the edge is a Names selection, but i do not know the syntax on how to make a named selection as a selection.

      If there is any way to resolve this it would be highly appreciated.

    • Atharv Joshi
      Forum Moderator

      Hi Kurian, 

      Do you want to translate the curve or want to create offset?

      Thanks and Regards
      Atharv

    • Atharv Joshi
      Forum Moderator

      If you are looking to create an offset curve please try below code. Once you have created surface, we enter the sketch mode and create an offset curve. Curve selection is done using GetRootPart().Curves[0]. 

      #Start Constraint Based Sketching
      result= SketchHelper.StartConstraintSketching()
       
      # Set Sketch Plane
      selection = FaceSelection.Create(GetRootPart().Bodies[0].Faces[0])
      result = ViewHelper.SetSketchPlane(selection)
      # EndBlock
       
      CurveToOffSet = Selection.Create(GetRootPart().Curves[0])
      offsetDistance = MM(-2)
      result= SketchOffsetCurve.Create(CurveToOffSet,offsetDistance)
       
      # Solidify Sketch
      mode = InteractionMode.Solid
      result = ViewHelper.SetViewMode(mode)
      # EndBlock
       
      Regards
      Atharv
    • Kurian Kuriakose
      Subscriber

      Thanks a lot !! 

      P. S: you must use it on a curve, not a surface(i lost too much time on this).

    • Atharv Joshi
      Forum Moderator

      Thanks for the confirmation, Kurian!

Viewing 4 reply threads
  • The topic ‘Problem with Offset while scripting in Spaceclaim’ is closed to new replies.