ajk441
Aerospace
- Jan 26, 2015
- 3
Hello.
I'm new to Abaqus GUI scripting. I'm trying to write a simple proof-of-concept Abaqus Plug-In that allows you to select an element, and then display that selected element in a textfield in the plugin. I'm using the RSG defined "PickHandler" function. I'm able to select elements in CAE. But once I click "Done" I'm not able to get those element values on the back end (within my Form.py AFXObjectKeyword). Or maybe I just don't know where to look.
Here's an image of my plugin:
Here's my PickHandler class:
class TestDBPickHandler(AFXProcedure):
count = 0
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
def __init__(self, form, keyword, prompt, entitiesToPick, numberToPick, label):
self.form = form
self.keyword = keyword
self.prompt = prompt
self.entitiesToPick = entitiesToPick # Enum value
self.numberToPick = numberToPick # Enum value
self.label = label
self.labelText = label.getText()
AFXProcedure.__init__(self, form.getOwner())
TestDBPickHandler.count += 1
self.setModeName('TestDBPickHandler%d' % (TestDBPickHandler.count) )
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
def getFirstStep(self):
return AFXPickStep(self, self.keyword, self.prompt,
self.entitiesToPick, self.numberToPick, sequenceStyle=TUPLE)
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
def getNextStep(self, previousStep):
self.label.setText( self.labelText.replace('None', 'Picked') )
return None
I'm new to Abaqus GUI scripting. I'm trying to write a simple proof-of-concept Abaqus Plug-In that allows you to select an element, and then display that selected element in a textfield in the plugin. I'm using the RSG defined "PickHandler" function. I'm able to select elements in CAE. But once I click "Done" I'm not able to get those element values on the back end (within my Form.py AFXObjectKeyword). Or maybe I just don't know where to look.
Here's an image of my plugin:
Here's my PickHandler class:
class TestDBPickHandler(AFXProcedure):
count = 0
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
def __init__(self, form, keyword, prompt, entitiesToPick, numberToPick, label):
self.form = form
self.keyword = keyword
self.prompt = prompt
self.entitiesToPick = entitiesToPick # Enum value
self.numberToPick = numberToPick # Enum value
self.label = label
self.labelText = label.getText()
AFXProcedure.__init__(self, form.getOwner())
TestDBPickHandler.count += 1
self.setModeName('TestDBPickHandler%d' % (TestDBPickHandler.count) )
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
def getFirstStep(self):
return AFXPickStep(self, self.keyword, self.prompt,
self.entitiesToPick, self.numberToPick, sequenceStyle=TUPLE)
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
def getNextStep(self, previousStep):
self.label.setText( self.labelText.replace('None', 'Picked') )
return None