Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

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

ABAQUS GUI PickHandler - AFXPickStep

Status
Not open for further replies.

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:

Capture_uxxlu7.png


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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor