Allows access to a slot mate feature.
.NET Syntax
Visual Basic (Declaration) | |
---|
Public Interface ISlotMateFeatureData |
C# | |
---|
public interface ISlotMateFeatureData |
C++/CLI | |
---|
public interface class ISlotMateFeatureData |
Example
'VBA
' ******************************************************************************
' 1. Open public_documents\samples\tutorial\api\MechanicalMates\slot_slot.sldasm.
' 2. Run the macro.
' 3. Inspect the Mates folder of 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(0.12649032355856, 0.133857958976421, 8.79467058769023E-03, 3.53905007657348E-02, 0.579257713320296, 0.814375843216443, 2.14371287556113E-03, 2, True, 1, 0)
boolstatus = Part.Extension.SelectByRay(9.59257342875013E-02, 9.99222046038994E-02, -2.51429018803719E-02, 3.53905007657348E-02, 0.579257713320296, 0.814375843216443, 2.14371287556113E-03, 2, True, 1, 0)
' Create SlotMateFeatureData
Dim MateData As SldWorks.SlotMateFeatureData
Set MateData = Part.CreateMateData(21)
' 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 alignment
MateData.MateAlignment = 0
' Set the mate constraint
MateData.Constraint = 0
' Create the mate
Dim MateFeature As SldWorks.Feature
Set MateFeature = Part.CreateMate(MateData)
Part.ClearSelection2 True
Part.EditRebuild3
End Sub
Example
Remarks
See Also