×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

origin

origin

(OP)
hello everybody!

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)
'****************************************************************** 
i tried this one but it gives wrong values!

RE: origin

(OP)
thank you AlexLozoya for you help! :)
the hole is already selected! but what "25.4" refers to?
after all, the values still wrong :(

RE: origin

Alex assumed you are using inches while CATIa script only use mm, so 25.4 will convert mm to inches.

Eric N.
indocti discant et ament meminisse periti

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources