×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

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

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

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

(OP)
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

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

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

CODE -->

vps = session.viewports.values()[0]
x = vps.displayedObject.name
print x 

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

(OP)
Thank you Mustaine3. That is exactly what I was looking for!

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources