Anyone know how to create a counter selection
Anyone know how to create a counter selection
(OP)
Hi friends
I try to create a script that count the select that I click
I have a rectangular prismatic, that have 6 faces
I want that if I click in 5 faces, the count show me a message where appears numer 5, and if I click in 3 faces, show me 3
Thanks
I try to create a script that count the select that I click
I have a rectangular prismatic, that have 6 faces
I want that if I click in 5 faces, the count show me a message where appears numer 5, and if I click in 3 faces, show me 3
Thanks





RE: Anyone know how to create a counter selection
Dim theComponent As Product
Set oSelection = CATIA.ActiveDocument.Selection
MsgBox(oSelection.Count)
that should do
indocti discant et ament meminisse periti
RE: Anyone know how to create a counter selection
A lot of thanks itsmyjob
Sub selecFace()
UserForm1.Hide
Dim Language As String
Language = "VBSCRIPT"
Dim colDocum As Documents
Dim DocActivo As Document
Dim Status As String
Dim myselection As Selection
Dim InputObjectType(0)
InputObjectType(0) = "AnyObject"
Dim refBorde As Reference
Set DocActivo = CATIA.ActiveDocument
Set myselection = DocActivo.Selection
Dim sel
Set sel = CATIA.ActiveDocument.Selection
sel.Clear
Dim total As Double
Dim cont As Integer
cont = 0
Dim TheMeasurable As Measurable
Dim TheSPAWorkbench As Workbench
Dim refBody
MsgBox "Select the face and click ESC to finish "
While cont <= 88
Status = sel.SelectElement2(InputObjectType, "Select the faces: ", True)
If (Status = "Cancel") Then
Exit Sub
End If
Dim oSelection As Selection
Dim theComponent As Product
Set oSelection = CATIA.ActiveDocument.Selection
Set refBody = myselection.Item(1).Value
total = oSelection.Count
sel.Clear
Wend
UserForm1.Show
This script work for my project, I hope that can you help anybody that try the same