Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

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

Iterating a body copy/move with a macro

Status
Not open for further replies.

ryan34

Aerospace
Aug 2, 2004
1
Hi Everyone...I am trying to set up up a macro that will rotate a body around the X-Axis (as a copy) and then rotate the copied body around the Z-axis, in equal increments for a given amount of iterations. Below is the code for the loop.

For I = 1 To 10

boolstatus = Part.Extension.SelectByID
("Extrude1", "SOLIDBODY", 0, 0, 0, False, 1, Nothing)
Part.FeatureManager.InsertMoveCopyBody2 0, 0, 0, 0, 0,
0, 0, -0.03490658503989 * I, 0, 0, True, 1

boolstatus = Part.Extension.SelectByID
("Body-Move/Copy<2*I-1>", "SOLIDBODY", 0, 0,
0,False, 1, Nothing)

Part.FeatureManager.InsertMoveCopyBody2 0, 0, 0, 0,
0,0, 0, 0, 0, 0.03490658503989 * I, False, 1

Next I

In the highlighted line I am trying to select the body that was just rotated around the X-axis to be rotated around the Z-axis (the pattern will be 1,3,5,...), but VB does not calculate 2*I-1 inside the quotations. Is there a way I can get the program to select Body-Move/Copy(2*I - 1)?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor