mayrou
Electrical
- Jan 8, 2014
- 55
hello everybody!
I tried to create a macro that give me the origin of a selected cercle!
i tried this one but it gives wrong values!
I tried to create a macro that give me the origin of a selected cercle!
Code:
MsgBox "selectionnez un trou"
Dim InputObjectType(0), Status1
InputObjectType(0)="Hole"
Status1=selection1.SelectElement2(InputObjectType,"Select un trou",false)
If Status1 = "Cancel" Then selection1.Clear: Exit Sub
Dim reference1 As Reference
Set oHole = selection1.Item(1).value
'************************Origine du trou********************************
'get the origin of the hole using the variant object
Dim origin(2)
oHole.GetOrigin (origin)
Msgbox "Origin = " & origin(0) & ", " & origin(1) & ", " & origin(2)
'******************************************************************