Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Sub Copy_to_Clipboard()
sString = "Paste To Clipboard"
Set WshShell = CreateObject("WScript.Shell")
Set oExec = WshShell.Exec("clip")
Set oWrite = oExec.stdIn
oWrite.WriteLine sString
oWrite.Close
End Sub
Sub CATMain()
Set oPartDocument = CATIA.ActiveDocument
Set oSelection = oPartDocument.Selection
oSelection.Clear
Dim oInputType(0)
Dim oStatus
Dim MySelection3 As Object
Set MySelection3 = oPartDocument.Selection
Dim inputObjectType(0) As Variant
InputObjectType(0) = "AnyObject"
Dim Result As String
Result = MySelection3.SelectElement2(InputObjectType, "Select a dimesion/text in 2D, or a Body/CATPart/CATProduct in 3D ", False)
Set mySelection = oSelection.Item(1).Value
Dim s 'As String
Dim strToLeft 'As String
s = mySelection.Name
strToLeft = Split(s,".")(0)
Set mySelection = oSelection.Item(1).Value
' Put it back to the clipboard
Set WshShell = CreateObject("WScript.Shell")
Set oExec = WshShell.Exec("clip")
Set oIn = oExec.stdIn
If strToLeft = "Dimension" Then
oIn.WriteLine mySelection.GetValue.Value
oIn.Close
ElseIf strToLeft = "Text" Then
oIn.WriteLine mySelection.Text
oIn.Close
ElseIf TypeName(MySelection3.Item(1).Value) = "Part" Then
oIn.WriteLine mySelection.Name
oIn.Close
ElseIf TypeName(MySelection3.Item(1).Value) = "Product" Then
oIn.WriteLine mySelection.Name
oIn.Close
ElseIf TypeName(MySelection3.Item(1).Value) = "Body" Then
oIn.WriteLine mySelection.Name
oIn.Close
ElseIf TypeName(MySelection3.Item(1).Value) = "Document" Then
oIn.WriteLine mySelection.Name
oIn.Close
End If
End Sub