Can we set visibility of created curves on same line of code?

Ansys Staff
Ansys Staff Member, Employee Posts: 24
Ansys Employee Name Dropper First Comment Photogenic
✭✭✭✭
edited June 2023 in 3D Design

Is is possible to set the visibility of created curves on this same line of code ?

result = DesignCurve.Create(GetRootPart(),CurveSegment.Create(PointCurve.Create(point)),False).SetColor(None, Color.FromArgb(transparency, redColor,greenColor,blueColor))

Answers

  • Valérie Gelbgras
    Valérie Gelbgras Member, Employee Posts: 157
    50 Answers 100 Likes 10 Comments Name Dropper
    ✭✭✭✭

    Did you try result = DesignCurve.Create(GetRootPart(),CurveSegment.Create(PointCurve.Create(point)),True).SetColor(None, Color.FromArgb(transparency, redColor,greenColor,blueColor))

  • Valérie Gelbgras
    Valérie Gelbgras Member, Employee Posts: 157
    50 Answers 100 Likes 10 Comments Name Dropper
    ✭✭✭✭

    To make sure it is not another parameter, Could you try with  DesignCurve.Create(p1,CurveSegment.Create(PointCurve.Create(point)),True)

  • Ansys Staff
    Ansys Staff Member Posts: 29
    10 Comments

    @Valérie Gelbgras Sorry this was my mistake your first proposal is actually working ! thankyou !

  • Valérie Gelbgras
    Valérie Gelbgras Member, Employee Posts: 157
    50 Answers 100 Likes 10 Comments Name Dropper
    ✭✭✭✭
    Answer ✓

    In the code below, I get the root part. Then from the root part, I get the first component. I create a point which is used to create a point curve itself used to create a trimmed curve. Finally the design curve is created. The visibility of the design curve is defined by the third argument.

    rootPart = GetRootPart()
    component = rootPart.Components[0]
    point = Point.Create(1, 1, 1)
    pointCurve = PointCurve.Create(point)
    trimmedCurve = CurveSegment.Create(pointCurve)
    DesignCurve.Create(rootPart, trimmedCurve, True)
    

    enter image description here