Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations waross on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Anyone know how to create a counter selection

Status
Not open for further replies.

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
 
Replies continue below

Recommended for you

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
 
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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Top