Allows access to a screw mate feature.
.NET Syntax
Visual Basic (Declaration) | |
---|
Public Interface IScrewMateFeatureData |
C# | |
---|
public interface IScrewMateFeatureData |
C++/CLI | |
---|
public interface class IScrewMateFeatureData |
Example
'VBA
' ******************************************************************************
' 1. Open public_documents\samples\tutorial\api\MechanicalMates\Gearbox.sldasm.
' 2. Delete Screw2 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(6.13295661213442E-03, 6.89560082602441E-02, 7.45357419147012E-02, -0.540837135649095, -0.258416475165147, -0.800447448659875, 7.89884801245894E-04, 2, True, 1, 0)
boolstatus = Part.Extension.SelectByRay(-6.75539884355203E-04, 7.95322044607474E-02, 1.28285894949158E-02, -0.540837135649095, -0.258416475165147, -0.800447448659875, 7.89884801245894E-04, 1, True, 1, 0)
' Create ScrewMateFeatureData
Dim MateData As SldWorks.ScrewMateFeatureData
Set MateData = Part.CreateMateData(17)
' 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 mate revolution type
MateData.RevolutionType = 0
' Set the mate revolution value
MateData.RevolutionVal = 1
' Set the mate orientation direction
MateData.Reverse = True
' Create the mate
Dim MateFeature As SldWorks.Feature
Set MateFeature = Part.CreateMate(MateData)
Part.ClearSelection2 True
Part.EditRebuild3
End Sub
Example
Remarks
Access Diagram
See Also