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!

Creating a PLUG IN in ABAQUS?

Status
Not open for further replies.

preethamschaeffler

Automotive
Jul 6, 2018
4

Hello everyone, I have made a python script to create a new variable in ABAQUS. The script is running fine. Now I am interested in making a plug in instead of running the file manually. It will be kind of you guys, if each of you who have a made a plug inm provide me your experience or advice on this topic. Doing so, I can ask or we can have a discussion which might be helpful to each of us. Thank you a lot in advance.
 
Replies continue below

Recommended for you

Do you just want to call the kernel script as plugin or do you also want a GUI to get input from the user?
 
Yes, i want to call the kernel script as plugin and also want a GUI to get input from the user. I know how can i create a GUI when it comes to creating a part of a model. But for this large script which i have made I dont know how to proceed. It is very important for me to go ahead in my project. The script is ready i only need to do plug in. I used excel macros, csv files ans integrated with python environment of abaqus to create a variable in ABAQUS. Please help me out.

preetham.alluri@gmail.com
allursip@schaeffler.com
 
I've just created Plugins with the GUI-Builder (RSG) that is provided with Abaqus/CAE as Plugin. With that it is simple to create a basic UI and connect that with the kernel script.

The A/CAE manual has a chapter about Plugins. The GUI Toolkit manuals might also help.
 
I see, that's great of you. How did you do it? did you parametrize it? I think there is no use of using the GUI TOOLKIT because whatever the things we do in the GUI PLUG IN box, it is automatically generating the python scripts(DB file, plugin file) of it in the respective folder. I have written one more script, say, for taking the photos automatically, I am inputting the following script in the kernel and what should i opt in GUI? please go through my script kindly, the script is running fine though. do i need to parametrize it? if yes how? sorry :)
There in indentation after defining the function, it is not taking the space here
from abaqus import *
from abaqusConstants import *
import odbAccess
import visualization
session.viewerOptions
from driverUtils import executeOnCaeStartup

def photos(photo):

# find current viewport vps (viewport set)
vps = session.viewports[session.currentViewportName]
# assign odb file from current viewport
odbFile = vps.displayedObject
# get file path and name
odbfilePath = odbFile.path
# split into separately name and path
odbFileName = os.path.split(odbfilePath)[1]
#odbPath = os.path.split(odbfilePath)[0]
odb = odbFile
myViewport=session.Viewport(name='Saving an image', origin=(10, 10), width=200, height=100)
myOdb = visualization.openOdb(path=odbfilePath )
myViewport.setValues(displayedObject=myOdb)
myViewport.partDisplay.geometryOptions.setValues(referenceRepresentation=ON)
myViewport.odbDisplay.display.setValues(plotState=(CONTOURS_ON_DEF, ))
myViewport.odbDisplay.commonOptions.setValues(visibleEdges=FEATURE, deformationScaling=UNIFORM,
uniformScaleFactor=0.8)
session.printOptions.setValues(rendition=COLOR,vpDecorations=OFF, vpBackground=OFF)
session.printToFile(fileName='newImage', format=TIFF, canvasObjects=(myViewport, ))
 
How shall I know what parameters the user wants to define for the routine? That's something you should know or clarify with the future users.

I've attached a really simple plugin, that just creates a block based on some user inputs. The kernel script is simple and the rest is created with the RSG.
 
 https://files.engineering.com/getfile.aspx?folder=16cb04f3-45c9-4eb9-adeb-0e8059ef8676&file=plugin_testblock.zip
Status
Not open for further replies.

Part and Inventory Search

Sponsor