Message 1 of 4
Hole Axis

Not applicable
02-08-2021
01:48 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I am writing some VBA and I am having a little trouble. I have an Assembly and I am trying to align a pin into a hole. I am having trouble figuring out the axis of the hole to mate with Z axis of the pin. Can anyone help me here and point me in the right direction?
Dim p1CompOcc As ComponentOccurrence
Dim p2CompOcc As ComponentOccurrence
Dim oHole As face
Set oHole = ThisApplication.CommandManager.Pick(SelectionFilterEnum.kPartFaceCylindricalFilter, "Pick Hole")
set p2CompOcc = oHole.ContainingOccurrence
Call ThisApplication.ActiveDocument.ComponentDefinition.Constraints.AddMateConstraint(p1CompOcc.Definition.WorkAxes.Item(3), oHole.Geometry.AxisVector, 0)