Dec 4, 2012 #1 gerlado Mechanical Oct 17, 2012 23 ES 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
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
Dec 4, 2012 #2 itsmyjob Mechanical Apr 11, 2002 2,375 CA Dim oSelection As Selection Dim theComponent As Product Set oSelection = CATIA.ActiveDocument.Selection MsgBox(oSelection.Count) that should do Eric N. indocti discant et ament meminisse periti Upvote 0 Downvote
Dim oSelection As Selection Dim theComponent As Product Set oSelection = CATIA.ActiveDocument.Selection MsgBox(oSelection.Count) that should do Eric N. indocti discant et ament meminisse periti
Dec 4, 2012 Thread starter #3 gerlado Mechanical Oct 17, 2012 23 ES This script Work 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 Upvote 0 Downvote
This script Work 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