🎉Community Raffle - Win $25

An exclusive raffle opportunity for active members like you! Complete your profile, answer questions and get your first accepted badge to enter the raffle.
Join and Win

Segmentation Error in Hyperworks 2019

User: "pat_20467"
Altair Community Member
Updated by pat_20467

Hi everyone,

I was wondering if anyone could help me identify what's causing the segmentation error?

I wrote a TCL Script as a test, the idea is to import a .dxf geometry, create solids then mesh them, then delete the model and import another .dxf to do the same thing.

However, Hyperworks always crashed during the meshing process of the 2nd geometry (I checked the crash0.hm file).

 

This seems to work when I did these manually, but running the script from command.tcl also produced a segmentation error at that exact spot.

Running it on a different computer didn't work either.

 

Thanks a lot in advance, would appreciate your help!

Find more posts tagged with

Sort by:
1 - 13 of 131
    User: "Ben Buchanan"
    Altair Employee
    Updated by Ben Buchanan

    This probably doesn't have anything to do with the crash put it doesn't look like you are saving your model before you delete the first one.  Looking through the code nothing stands out as a problem.  I usually add puts statements in my code to see if I can narrow it down to the exact line where it is a problem.  This is a little hard with segmentation errors because you can't scroll up or look into it after put if you have the tcl console open you should be able to see the last puts statement that gets output before the window closes.

    Also I would suggest putting this in a loop.  Maybe create a list of all the files you want to do this for then do something like this:

    foreach dxfFile $fileList {

        <the code here

    }

    and I would probably add an export step.  Also I would get it working robustly for one file before I tried it for 2 or more files.

    User: "pat_20467"
    Altair Community Member
    OP
    Updated by pat_20467

    This probably doesn't have anything to do with the crash put it doesn't look like you are saving your model before you delete the first one.  Looking through the code nothing stands out as a problem.  I usually add puts statements in my code to see if I can narrow it down to the exact line where it is a problem.  This is a little hard with segmentation errors because you can't scroll up or look into it after put if you have the tcl console open you should be able to see the last puts statement that gets output before the window closes.

    Also I would suggest putting this in a loop.  Maybe create a list of all the files you want to do this for then do something like this:

    foreach dxfFile $fileList {

        <the code here

    }

    and I would probably add an export step.  Also I would get it working robustly for one file before I tried it for 2 or more files.

    Thanks for your answer!

     

    I did write a script using loops, but I'll try with foreach command too.

    The reason I wrote the previous script (crashtest) was because meshing the solid for the 2nd time seems to be the problem.

    User: "Ben Buchanan"
    Altair Employee
    Updated by Ben Buchanan

    Thanks for your answer!

     

    I did write a script using loops, but I'll try with foreach command too.

    The reason I wrote the previous script (crashtest) was because meshing the solid for the 2nd time seems to be the problem.

    So you are getting a segmentation error with this script still?  If so I would try with each file individually to see if it is file specific or if it is an issue with the script in the second loop.
    Can you share the models?  Might be able to help a little more if I can test it on my end.

    User: "Ben Buchanan"
    Altair Employee
    Updated by Ben Buchanan

    Thanks for your answer!

     

    I did write a script using loops, but I'll try with foreach command too.

    The reason I wrote the previous script (crashtest) was because meshing the solid for the 2nd time seems to be the problem.

    Do you know which line it crashes on?

    User: "pat_20467"
    Altair Community Member
    OP
    Updated by pat_20467

    Do you know which line it crashes on?

    The model unfortunately doesn't belong to me so I can't share it :(

    However the script does not depend on whether the model is there or not, so I commented the lines that open the model.

     

    It crashes on line 52 (testkombination.tcl) and line 42 (crashtest.tcl)

    User: "Ben Buchanan"
    Altair Employee
    Updated by Ben Buchanan

    The model unfortunately doesn't belong to me so I can't share it :(

    However the script does not depend on whether the model is there or not, so I commented the lines that open the model.

     

    It crashes on line 52 (testkombination.tcl) and line 42 (crashtest.tcl)

    Try adding a *clearmarkall 1 and *clearmarkall 2 at the end of the loop or before the second attempt.

    User: "pat_20467"
    Altair Community Member
    OP
    Updated by pat_20467

    Try adding a *clearmarkall 1 and *clearmarkall 2 at the end of the loop or before the second attempt.

    It didn't work unfortunately :(

     

    I added them here:

    (testkombination)

    image

     

    (crashtest)

    image

    User: "Ben Buchanan"
    Altair Employee
    Updated by Ben Buchanan

    It didn't work unfortunately :(

     

    I added them here:

    (testkombination)

    image

     

    (crashtest)

    image

    Another thing I sometimes try when debugging code is to copy the code into the tcl console one line at a time to see if you getting any errors.

    You could also to a puts statement to check if any of your marks are empty.

    It seems like it will be something with the marks since that is about all the input the *solidmap_solids_begin needs.  Made try clearing the mark in other spots too.  It is good practice to clear the mark once you no longer need it.  Sometimes setting the mark to a variable and then clearing is a good way to make sure you have the information when you need it but marks aren't interfering with each other.  You could also change some of them to use mark 2.

    User: "pat_20467"
    Altair Community Member
    OP
    Updated by pat_20467

    Another thing I sometimes try when debugging code is to copy the code into the tcl console one line at a time to see if you getting any errors.

    You could also to a puts statement to check if any of your marks are empty.

    It seems like it will be something with the marks since that is about all the input the *solidmap_solids_begin needs.  Made try clearing the mark in other spots too.  It is good practice to clear the mark once you no longer need it.  Sometimes setting the mark to a variable and then clearing is a good way to make sure you have the information when you need it but marks aren't interfering with each other.  You could also change some of them to use mark 2.

    I'll try that, thanks a lot for your help!

    User: "PaulAltair"
    Altair Employee
    Updated by PaulAltair

    I'll try that, thanks a lot for your help!

    I don't have any dxf to try with, but I wonder if it is related to that reader, the dxf reader is quite old, I did something similar with step, and had no issues, my example step/tcl attached, it writes 2x hm files of the meshed solids, this was done in 2021 though, so may not work in your 2019 build.

    User: "pat_20467"
    Altair Community Member
    OP
    Updated by pat_20467

    I don't have any dxf to try with, but I wonder if it is related to that reader, the dxf reader is quite old, I did something similar with step, and had no issues, my example step/tcl attached, it writes 2x hm files of the meshed solids, this was done in 2021 though, so may not work in your 2019 build.

    Hey, thanks for your answer.

    May I ask how did you create the sketches as stp? I tried doing so with Autocad but Hypermesh didn't recognize it.

    User: "PaulAltair"
    Altair Employee
    Updated by PaulAltair

    Hey, thanks for your answer.

    May I ask how did you create the sketches as stp? I tried doing so with Autocad but Hypermesh didn't recognize it.

    I just created those directly in HW, geometry ribbon, and exported from HW as STEP, I don't have a CAD package

    User: "Ben Buchanan"
    Altair Employee
    Updated by Ben Buchanan

    Hey, thanks for your answer.

    May I ask how did you create the sketches as stp? I tried doing so with Autocad but Hypermesh didn't recognize it.

    I have found Inspire Studio does a good job of reading in CAD that HW won't and then you can export from Inspire Studio and then it will usually read into HW.