🎉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

Find Hole and Create Rigid, In this script, How to add Outer Periphery nodes of the Hole also to Create a Rigid, Currently it only take inner Nodes of the Hole Based on the element edges, but we need to add outer periphery of node so that it create r

proc spider {} {

    if { [ hm_marklength nodes 1 ] != 1 } {
        hm_errormessage "More than one node passed to spider procedure"
        return {}
    }
    set nodeId [ hm_getmark nodes 1 ]

    hm_blockmessages 1
    *entityhighlighting 0
    *clearmark comps 2
    *findmark nodes 1 1 1 components 0 2

    *findedges components 2 0

    *createmark elems 1 "by comps" {^edges}
    set edgeElems [ hm_getmark elems 1 ]
    foreach eId $edgeElems {
        set plotelem2Nodes($eId) [ hm_nodelist $eId ]
        foreach nId $plotelem2Nodes($eId) {
            lappend node2Plotelems($nId) $eId
        }
    }
    *deleteedges
    hm_blockmessages 0
    *entityhighlighting 1

    if { ! [ info exists node2Plotelems($nodeId) ] } {
        # selected node is not on an edge
        hm_errormessage "Please select a node on an edge."
        return {}
    }

    set endNode $nodeId
    set nodelist {}

    set nextNode $nodeId
    set nextElem [ lindex $node2Plotelems($nodeId) 0 ]
    set counter 0
    lappend nodelist $nextNode
    while { $counter < 10000 } {
        set prevNode $nextNode
        set prevElem $nextElem
        set nextNode [ lremove $plotelem2Nodes($prevElem) $prevNode ]
        lappend nodelist $nextNode
        if { $nextNode == $endNode } { break }
        set nextElem [ lremove $node2Plotelems($nextNode) $prevElem ]
        incr counter
    }
    if { $counter > 9999 } { set nodelist {} }

    # create and return the element
    set elemId {}
    if { [ llength $nodelist ] } {
        eval *createmark nodes 2 $nodelist
        *rigidlinkinodecalandcreate 2 0 0 123456
        set elemId [ hm_entitymaxid elems ]
    }
    return $elemId
}

image

Here it takes only inner Periphery of the Hole, Can you Help me to Update that, So that it can take outer node of washer as well 

Find more posts tagged with

Sort by:
1 - 2 of 21