Allows access to gear mate features.
.NET Syntax
Visual Basic (Declaration) | |
---|
Public Interface IGearMateFeatureData |
C# | |
---|
public interface IGearMateFeatureData |
C++/CLI | |
---|
public interface class IGearMateFeatureData |
Example
'VBA
' ******************************************************************************
' 1. Open public_documents\samples\tutorial\api\MechanicalMates\spurgear.sldasm.
' 2. Delete GearMate1 from the Mates folder of the FeatureManager design tree.
' 3. Run the macro.
' 4. Inspect the Mates folder in the FeatureManager design tree.
' ******************************************************************************
Dim swApp As SldWorks.SldWorks
Dim Part As SldWorks.ModelDoc2
Dim boolstatus As Boolean
Option Explicit
Sub main()
Set swApp = Application.SldWorks
Set Part = swApp.ActiveDoc
boolstatus = Part.Extension.SelectByRay(-5.60801689982782E-03, -3.24062886681986E-03, -2.52602902980925E-03, -0.577381545199981, -0.577287712085548, -0.577381545199979, 5.93757005519753E-04, 2, True, 1, 0)
boolstatus = Part.Extension.SelectByRay(3.67362652137331E-02, -6.55599730123413E-04, -2.90761848191323E-03, -0.577381545199981, -0.577287712085548, -0.577381545199979, 5.93757005519753E-04, 2, True, 1, 0)
' Create GearMateFeatureData
Dim MateData As SldWorks.GearMateFeatureData
Set MateData = Part.CreateMateData(10)
' Set the entities To mate
Dim EntitiesToMate(1) As Object
Set EntitiesToMate(0) = Part.SelectionManager.GetSelectedObject6(1, -1)
Set EntitiesToMate(1) = Part.SelectionManager.GetSelectedObject6(2, -1)
Dim EntitiesToMateVar As Variant
EntitiesToMateVar = EntitiesToMate
MateData.EntitiesToMate = (EntitiesToMateVar)
' Set the gear ratio numerator
MateData.GearRatioNumerator = 0.012954
' Set the gear ratio denominator
MateData.GearRatioDenominator = 0.012954
' Set the mate orientation direction
MateData.Reverse = False
' Create the mate
Dim MateFeature As SldWorks.Feature
Set MateFeature = Part.CreateMate(MateData)
Part.ClearSelection2 True
Part.EditRebuild3
End Sub
Example
Remarks
See Also