×
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

DEFINE A REGION

DEFINE A REGION

DEFINE A REGION

(OP)
Hello
How can I define a region through edges such as edge[0],edge[3],edge[4].....
On the other hand the number of these edges is variable according to the case
for example i make this :
region = p.SetFromElementLabels(elementLabels=edges11, name='Wire_cubic_cell1')
p = mdb.models['Model-1'].parts['Part-1']
p.SectionAssignment(region=region, sectionName='cylindrical_section1', offset=0.0,
offsetType=MIDDLE_SURFACE, offsetField='',
thicknessAssignment=FROM_SECTION)
such as edges11 contain the index of edges,edges11=(0,3,4,7,8,....)
but in the affection of section i have error "region, found none,expecting region

thanks

RE: DEFINE A REGION

Do you want to create a set with elements or with edges? Clarify what kind of entity you want to use and don't mix it randomly.

RE: DEFINE A REGION

(OP)
with edges!

RE: DEFINE A REGION

Do you want to use all edges of your part? Then you could use a slicing, that is larger than needed.

CODE -->

p = mdb.models['Model-1'].parts['Part-1']
e = p.edges
edges = e[0:100]
p.Set(edges=edges, name='Set-1') 

RE: DEFINE A REGION

(OP)

I do not want to use all the edges but I want to use some edges already chosen

RE: DEFINE A REGION

Then do it with a loop and combine the single slices.

CODE -->

p = mdb.models['Model-1'].parts['Part-1']

ids = [1, 3, 4, 7]

for i,x in enumerate(ids):
	if i==0:
		eregion = p.edges[x:x+1]
	else:
		eregion = eregion + p.edges[x:x+1]

p.Set(edges=eregion, name='Set-1') 

RE: DEFINE A REGION

(OP)
thanks!

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