1

I want to define two Reference points in two edges of the same instance in the assembly so that I can use them for defining constraints later on in the model. My code looks like this :

myAssembly.ReferencePoint(point=(0.0,50.0,0.0))
r1=myAssembly.referencePoints
refpoints1=(r1[3],)
myAssembly.Set(referencePoints=refpoints1, name='RF-Displacement')

myAssembly.ReferencePoint(point=(10.0,50.0,0.0))
r2=myAssembly.referencePoints
refpoints2=(r2[3],)
myAssembly.Set(referencePoints=refpoints2, name='RF-Fix')

The reference points and the sets are created but both the sets refer to the first reference point. How to create two reference points and select each one as a different set?

I think I am making a mistake in accessing the second reference point. Will be glad if someone could point out my mistake.

Alan Kavanagh
  • 9,425
  • 7
  • 41
  • 65
Schneider
  • 37
  • 1
  • 8

1 Answers1

1

when you create the point grab its index like this:

 pointid=myAssembly.ReferencePoint(point=(0.0,50.0,0.0)).id

then reference it like this:

 myAssembly.Set(referencePoints=
    (myAssembly.referencePoints[pointid],),
      name='RF-Displacement')

Its never a good idea to hard code indices as you were.

agentp
  • 6,849
  • 2
  • 19
  • 37