Hi,
I was wondering if anyone knows of a way to get the coordinates of the reference axis that is used by a coincidence constraint in Assembly design.
I am after the location where the axis intersects the plane of the part.
I have been able to get the direction of the axis using
Set oRef1 = Constraint1.getconstraintelement(1)
Set constraintaxis1 = TheSPAWorkbench.GetMeasurable(oRef1)
Dim aAxisVector(2)
constraintaxis1.GetDirection aAxisVector
And I can get the center point of a hole that an axis runs through, using.
Dim SelectionA As Selection
Set SelectionA = productDocument1.Selection
SelectionA.Search "CATPrtSearch.Hole,all"
Dim theHole As Hole
Set theHole = SelectionA.Item(i).Value
Dim vHole As Variant
Set vHole = theHole
Dim origin(2)
vHole.GetOrigin origin
The origin of the hole printed will correspond to the Axis vector in the case where there is only one hole per part and one coincidence. As soon as further complexity is introduced using this method becomes useless.
Is there a way to get the origin of the axis that has been derived from the constraint. or even link the hole to the constraint so the information is paired?
Thanks for your time.
Dael
I was wondering if anyone knows of a way to get the coordinates of the reference axis that is used by a coincidence constraint in Assembly design.
I am after the location where the axis intersects the plane of the part.
I have been able to get the direction of the axis using
Set oRef1 = Constraint1.getconstraintelement(1)
Set constraintaxis1 = TheSPAWorkbench.GetMeasurable(oRef1)
Dim aAxisVector(2)
constraintaxis1.GetDirection aAxisVector
And I can get the center point of a hole that an axis runs through, using.
Dim SelectionA As Selection
Set SelectionA = productDocument1.Selection
SelectionA.Search "CATPrtSearch.Hole,all"
Dim theHole As Hole
Set theHole = SelectionA.Item(i).Value
Dim vHole As Variant
Set vHole = theHole
Dim origin(2)
vHole.GetOrigin origin
The origin of the hole printed will correspond to the Axis vector in the case where there is only one hole per part and one coincidence. As soon as further complexity is introduced using this method becomes useless.
Is there a way to get the origin of the axis that has been derived from the constraint. or even link the hole to the constraint so the information is paired?
Thanks for your time.
Dael