Scripting surfaces in SpaceClaim 2023 R2 getting slow


I wrote a script for creating a geometry of beams and surfaces in space claim 2021 R1. Now I'm testing it in 2023 R2 and I am getting several problems:
-The script is 10x slower and it seems that the surfaces are the problem.
-sometimes lines are not solidified and are not converted into beams, it seems to happen randomly
Have anyone incurred in the same problems?



  • Mike.Thompson
    Mike.Thompson Member, Employee Posts: 278
    First Anniversary First Comment 5 Likes Ansys Employee

    Can you provide snippets of how you create the surfaces and lines? There are multiple ways to do this so knowing what API calls you use would help a lot.
    Also are you saying you get different speeds and results when running the exact same scripts multiple times?

  • Pernelle Marone-Hitz
    Pernelle Marone-Hitz Member, Moderator, Employee Posts: 804
    First Comment First Anniversary Ansys Employee Solution Developer Community of Practice Member

    @Gabriel Messager do you have an idea here?

  • riccardoPD
    riccardoPD Member Posts: 4
    First Comment

    Hello Mike,
    I really appreciate your help and excuse in advance for my inexperience
    This is the snippet I use for creating surfaces:
    point1 = Point2D.Create(MM(xP1),MM(yP1))
    point2 = Point2D.Create(MM(xP2),MM(yP2))
    point3 = Point2D.Create(MM(xP3),MM(yP3))
    result = SketchRectangle.Create(point1, point2, point3)
    I create a series of rectangles in this way in a for loop, moving the sketch plane in every iteration. Then:

    Solidify Sketch

    mode = InteractionMode.Solid
    result = ViewHelper.SetViewMode(mode)


    This operation works fine in SC 2021 R1, but it's very slow in 2023 R2.

    For the second issue:
    I create in for loop a line segmented in different "sublines" (number of "sublines"=cont), then I select them to be converted in beams, through this selection method:

    curves=all_curves[-cont:] #curves to be converted in beams
    selection_curve = Selection.Create(curves)

    I think the problem could lie here:
    This is still an hypothesis that I have to check, but it could be that in 2023 the order of curves is not coherent with the creation order and so I fail to select them correctly.