🎉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

How to identify selected line is straight or Curve?

User: "Bhavik Sheth_21143"
Altair Community Member
Updated by Bhavik Sheth_21143

Hello Team,

I have used below function to select line.

*createmarkpanel lines 1 'Select line'the 
  set WCL [hm_getmark lines 1]
  *clearmark lines 1

After selection, I need to check whether selected line is straight or not.

Suggestion please how to proceed.

Thank you in advance.

 

Find more posts tagged with

Sort by:
1 - 1 of 11
    User: "Rishabh"
    Altair Employee
    Updated by Rishabh

    Hello Bhavik

    You can try the following steps : 

    1. If a line is straight , the a center won't be created of this line type. In Hypermesh try to create a center node using straight line as an input and it would throw an error. 

    2. In Tcl scripting, you can find the command that finds center node for an arc/circle from reference guide . The commands are :                                                                                                                    *createlist nodes 1 1 2
    *linecreatefromnodes 1 0 150 5 179 

    3. You can introduce an error handling using a catch command to check if the input line given as an argument to this command  causes an error or not .

    *createlist nodes 1 1 2

    curve_list = [list]

    straight_line_list = [list]

    if ([catch {*linecreatefromnodes 1 0 150 5 179 }] == 1) {

    lappend straight_line_list $line_id # Find line id in your code

    # Line is straight 

    } else {

    #Line is a curve

    lappend curve_list $line_id # Find line id in your code

    }