Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

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

Abaqus python script code to access active model/part in Abaqus/C 1

Status
Not open for further replies.

Wibbs13

Mechanical
Joined
Jan 31, 2014
Messages
4
Location
US
I am attempting to make a code which will automatically assign a part object variable, say myPart, to the part that is active in my Abauqs/CAE GUI.


Ex 1) ** Hard Coding
myPart= mdb.models['Model-1'].parts['Part-1']

Ex 2) ** User Inputs
modName = getinput ('Enter Model Name')
partPame = getinput ('Enter Part Name')
myPart = mdb.models[modName].parts[partName ]

Rather than using methods as defined above, I am search for something like
myPart = activePartInGuiDisplay (or whatever is needed to accomplish such an action)

Any help is appreciated.

Much Thanks,

-Wibbs13
 
For a part-level object (part) it is simple...

Code:
vps = session.viewports.values()[0]
x = vps.displayedObject.name
print x
 
Thank you Mustaine3. That is exactly what I was looking for!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top