Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations IDS on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to select CAEEdge and CAEVertex with NXOpen?

Status
Not open for further replies.

jcap1

Aerospace
Aug 27, 2020
2
Hi,

I'm very new to NXOpen.

I'm trying to replace the component1.FindObject selection stickiness in the journal file I recorded:
Code:
Dim cAEEdge1 As NXOpen.CAE.CAEEdge = CType(component1.FindObject("PROTO#CAE_Body(1)|CAE_Edge(1)"), NXOpen.CAE.CAEEdge)
Dim cAEVertex1 As NXOpen.CAE.CAEVertex = CType(component1.FindObject("PROTO#CAE_Body(1)|CAE_Vertex(2)"), NXOpen.CAE.CAEVertex)

I've found some examples for how to do this for a face but not for a CAE edge or vertex.

Ideally I would like to reference the CAE edge by a user given attribute name (e.g. TopEdge) and then select the start or end vertex of the edge.

I've been searching around but don't know where to go from here.

Again, I'm just starting out so sorry if this is a very basic question.

Thanks ahead of time.
 
Replies continue below

Recommended for you

In Python I would create a function to narrow the selection like this.

Python:
def SelectCAEObj ():
    
    theUI = NXOpen.UI.GetUI()#: :type theUI: NXOpen.UI    
    itemsPicked = 0
    message = "pick CAE Object"
    title = "Selection CAE Object"
    scope = NXOpen.SelectionSelectionScope.WorkPart
    selectionAction = NXOpen.Selection.SelectionAction.ClearAndEnableSpecific
    includeFeature = False
    keepHighligted = False
    
    selectionMaskArray=[]
      
    #selectionMaskArray.append(NXOpen.Selection.MaskTriple(objType,objSubType,objBodyDubType))    
    selectionMaskArray.append(NXOpen.Selection.MaskTriple(31,10,0))# UF_caegeom_edge_subtype
    selectionMaskArray.append(NXOpen.Selection.MaskTriple(31,11,0))# UF_caegeom_vertex_subtype 
   
    resp = theUI.SelectionManager.SelectTaggedObject(message, title, scope, selectionAction, includeFeature, keepHighligted, selectionMaskArray)
   
    if resp[0] == NXOpen.SelectionResponse.ObjectSelected:
        itemsPicked = resp[1]
        return itemsPicked
    
    elif resp[0] == NXOpen.SelectionResponse.ObjectSelectedByName:
        itemsPicked = resp[1]
        return itemsPicked
    else:
        return  NXOpen.SelectionResponse.Cancel

The format for VB would be similar.
 
Thank you for the method.
It looks to be something that will prompt the user to select something manually.
Is that correct?

What I'm trying to do is programatically select the edge and vertex by name, so you can pass the function a name and have it create boundary condition objects.
Would you know how to do that?

The sticking point may be the vertex since you may not be able to name a vertex.
Maybe after the edge is selected by name, the start or end vertex of it can be identified somehow?
Is there a CAEvertex child array of edge that can be used for this purpose or a better way?

Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor