Hi All,
I am writing a macro to add an AngleConstraint to my assembly that specifies the third axis for rotation.
I am creating the constraint based off an existing constraint that also uses the third axis for rotation.
'basically copying the constraint from a pickedObject to a new part
The macro works fine, however if the third axis is flipped from the default in the originally pickedobjec.
When the new AngleConstraint is created the 'ReferenceVectorEntity' used to position the part is not flipped
and there does not appear to be a property to change it.
below is a small snippet of my code to give an idea of my macro
My question is, Is there a way to flip the ReferenceVectorEntity?
Dim ReferenceVector As Variant
Set ReferenceVector = pickedObjectConstraint.ReferenceVectorEntity
' Create the Angle constraint between the parts.
Dim oConstraint As AngleConstraint
Set oConstraint = oAsmCompDef.Constraints.AddAngleConstraint(oBrepEnt1, oBrepEnt2, pickedObjectConstraint.Angle.Expression, pickedObjectConstraint.SolutionType, ReferenceVector)
Thanks
Stuart
Hi Stuart,
There does not seem to be such a property in the UI either. If you want to have a flipped effect then just set the angle to a negative value.
Cheers,
Hi Stuart,
Thanks for pointing that out. Also if I hover above an edge long enough then I can select the opposite direction.
Best thing to debug things like these is: http://adndevblog.typepad.com/manufacturing/2013/10/discover-object-model.html
If you create two AngleConstraints using the same edges for EntityTwo and ReferenceVectorEntity, but using reverse direction then you can see what's different between those two constraints.
You'll find that both EntityTwo and ReferenceVectorEntity are the same for the two constraints, so those properties cannot contain the direction information. For EntityOne and EntityTwo there are hidden, read-only properties showing if they are reversed: DirectionOneReversed and DirectionTwoReversed, but there is no such property for ReferenceVectorEntity.
I logged a wish-list in our system for exposing the necessary properties and ability to create AngleConstraint with reversed directions: id 1510611
Cheers,