Message 1 of 6

Not applicable
04-21-2016
12:03 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Can someone take a look at the code below and tell me what I'm doing wrong? I keep getting the error message : "ClickA is masking a variable in a global bloc" or some such. It's in french ("La variable 'ClickA' masque une variable dans un bloc englobant").
I figure it means that a variable is being declared twice, but I put it in a "IF" loop, so it should not see the second one, right?
Thank you.
SyntaxEditor Code Snippet
' --- Choisis la methode' Face - Face' Face - Point' Point - Point Dim Choix1 as Boolean Dim Choix2 as Boolean Dim DistPoints As Double Dim DistPoints2 As Double Dim oDoc As PartDocument oDoc = ThisApplication.ActiveDocument
'--- First selection Choix1 = InputRadioBox("Choisis le type de selection : ", "Face", "Point", True, Title := "Premiere Selection d'entite" If Choix1 = True Dim ClickA As Face ClickA = ThisApplication.CommandManager.Pick(SelectionFilterEnum.kPartFaceFilter, "Clique sur la Face 1 : ") Else Dim ClickA As Point ClickA = ThisApplication.CommandManager.Pick(SelectionFilterEnum.kAllPointEntities, "Clique sur le Point 1 : ") End If
'--- Second selection Choix2 = InputRadioBox("Choisis le type de selection : ", "Face", "Point", True, Title := "Deuxieme Selection d'entite") If Choix2 = True Dim ClickB As Face ClickB = ThisApplication.CommandManager.Pick(SelectionFilterEnum.kPartFaceFilter, "Clique sur la Face 2 : ") Else Dim ClickB As Point ClickB = ThisApplication.CommandManager.Pick(SelectionFilterEnum.kAllPointEntities, "Clique sur le Point 2 : ") End If
'--- Measure distance DistPoints = ThisApplication.MeasureTools.GetMinimumDistance(ClickA, ClickB) DistPoints2 = DistPoints / 2.54 MessageBox.Show("Longueur = " & DistPoints2 & " pouces", "Title")
Solved! Go to Solution.