Angle Constraint Challenge

Michael Laursen

Angle Constraint Challenge

Hi all fellow CATIA Guru's.. 
I'm trying to redefine the way we constraint assemblies. 
I'm trying to use an Angle constraint, but i run in to the issue that there are two solutions. The 0deg or 180deg depending on the position of the two components being constraint together. 

Is there a way to control this in VBA..? 

Looking at the picture with the numbers... the depending on the component sequence (Part1 -> Part2) or ( Part2 -> Part1) a coincidence constraint will be made between (1&2, 3&4, and an angle constraint on 7&8) or (2&1, 5&6 and the angle on 7&8) 

My problem is that i don't have any control over the position of the part and would like to have some consistency and make sure that my 45deg angle constraint won't be 180deg off.. because it have flipped to the other side. 

and in this case, the AxisSystem is not an option.. :-) 

Do you understand the issue..? 

Let me know your thoughts or if you have any genius alternativ. The constraints will be created by VB/VBA.  
 

Attachments

  • 2021-07-07 09_17_07-Window.png (163.3k)
  • 2021-07-07 09_44_08-Window.png (121.9k)
  • 2021-07-07 09_48_05-Window.png (139.3k)
  • 2021-07-07 09_44_22-Window.png (96.5k)

Alessandro Gaffuri, Eng.

RE: Angle Constraint Challenge
(in response to Michael Laursen)

Hello,

for what I understand this is not a VBA problem but a geometrical one, I don't think you can position correctly your components if you always have 2 solutions (0 and 180deg) and you don't have anything that makes you understand where you are in the 3d space. I think an axis system would be needed, this is my thought so I might be wrong ;)

MS Eng. Alessandro Gaffuri

Michael Laursen

RE: Angle Constraint Challenge
(in response to Alessandro Gaffuri, Eng.)

Hi Alessandro, 

You're absolutely right.. it's not a VBA problem.. :-) But maybe some have encountered this before who might have a workaround. I know about the AxisSystems.. but they can't be used in all cases.. sometimes we need to have different positions depending on i which assembly it is used. 

If i where using planes, then the VBA coincidence constraint will always be created so that the vector normal to the plane always point in the same direction. But it seems like it's not the same for angle constraints.. It would have been cool if it were.. because i can control the direction of a line, or inverse a plane/surface and use that to control the direction. 

But i'll keep working and maybe i'll have to make a constraint to a plan before the angle constraint and then delete the first constraint before setting the angle.. It just seem a bit cumbersome. 

Josh Bender

RE: Angle Constraint Challenge
(in response to Michael Laursen)

Michael,

 

This is definitely a frustrating issue. It seems to me to automatically swap angle sectors (clockwise vs counter clockwise) if the angle is >180 degrees. But it is repeatable for positioning up until that point.

 

What if you got it close to what you want using a parallelism or perpendicularity constrain first? I was able to repeat an angle constraint by first creating a parallelism constraint with a set of planes, updating the parallelism constraint, deleting the parallelism, and then creating the angle constraint. It's messy, but it may be a workaround?