Hi all,
I'm programmming an application which requires a selection of nodes (on a FemPart) by the user.
I am using the SelectTaggedObjects function from the SelectionManager, but the problem is that I don't know exactly which Type and Subtype to put in the MaskTriple. I've tried several possibilities, but no one works... The selection window shows up, but the selection filter is always on "curve feature" and it is not possible to select anything.
Here is my code, I've created a function which takes in argument the message to display, the type and the subtype of the objects to select:
Dim theSession As Session = Session.GetSession()
Dim workFemPart As CAE.FemPart = CType(theSession.Parts.BaseWork, CAE.FemPart)
Dim fEModel1 As CAE.FEModel = CType(workFemPart.FindObject("FEModel"), CAE.FEModel)
Dim selectedObjects() As TaggedObject
selectedObjects = SelectObject("Please select interface nodes", UFConstants.UF_sfem_mesh_type, UFConstants.UF_sfem_mesh_nodes_subtype)
Function SelectObject(ByVal message As String, ByVal Type As Integer, ByVal Subtype As Integer) As TaggedObject()
Dim title As String = "Selection"
Dim context As Selection.SelectionScope = Selection.SelectionScope.AnyInAssembly
Dim keepHighlighted As Boolean = False
Dim includeFeautures As Boolean = True
Dim selectionAction As Selection.SelectionType = Selection.SelectionAction.ClearAndEnableSpecific
Dim mask(0) As Selection.MaskTriple
mask(0).Type = Type
mask(0).Subtype = Subtype
mask(0).SolidBodySubtype = 0
Dim selectedObject() As TaggedObject = Nothing
Dim ui As UI = ui.GetUI()
ui.SelectionManager.SelectTaggedObjects(message, title, context, selectionAction, includeFeautures, keepHighlighted, mask, selectedObject)
Return selectedObject
End Function
I can't find where the problem comes from, so any help would be greatly appreciated !
Thanks!
re: node selection
Apparently, the nodes cannot be selected directly. I found some code in the GTAC solution database that may help you; it creates temporary points on the nodes, allows the user to select the points, and returns the nodes based on which points were selected by the user. It's a round about way of getting the nodes, but it works.
https://solutions.industrysoftware.automation.siemens.com/view.php?sort=...
re: node selection
Ok thank you! I will have a look at it !
And what about the Block UI styler ?
I have created a SelectNode block. It shows up correctly, but I don't know how to get the nodes I have selected once I've clicked on the "OK" button. I guess I have to complete the vb template file (generated when creating the block) but I have no idea how to do that...
re: block styler
I don't currently have access to a block styler license, so I can't really comment on using it effectively.