×
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

Catia macro for moving a part

Catia macro for moving a part

Catia macro for moving a part

(OP)
Hi,

I am new to vba and catia scripting and i have to create a macro that moves a part from one place to another,
more specificly i need the function of the move activity in vba.(the parameters doesn't matter so much just an idea because i am stuck)

Thanks a lot,
Chris

RE: Catia macro for moving a part

The Move object is used to perform transformations on child components by using a twelve member variant array.

Dim prod1 As Product
Set prod1 = CATIA.ActiveDocument
Set prodInd = prod1

Dim moveArray(11)
moveArray(0)=1
moveArray(1)=0
moveArray(2)=0
moveArray(3)=0
moveArray(4)=1
moveArray(5)=0
moveArray(6)=0
moveArray(7)=0
moveArray(8)=1
moveArray(9)=1000 'translates component 1000 x direction of parent's coordinate space
moveArray(10)=0
moveArray(11)=0
prodInd.Move.Apply moveArray

http://excelspreadsheetshelp.blogspot.com - http://scripting4v5.com

RE: Catia macro for moving a part

(OP)
Thank you for the instant reply.
I don't know if the names (prod1 etc) are imortant to the code syntax.

Also when running this exact macro at a process with 2 products, there is an errorQ Object doesn't support this property or method 'prodInd.move'

RE: Catia macro for moving a part

(OP)
It's ok sorry for your time!
I was new to macros and now i understand what you meant.

I actually want to create an array which consists of the products of the PPR tree
and move them.
I am working on it but if you have any idea it would be very helpful.

Regards

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