Steve Cox Posted February 11, 2003 Share Posted February 11, 2003 I'm new to scripting so this may be a dumb question. I can't get the Rotate3D command to do anything. This is my script: Duplicate (0,120); Rotate3D (-90d,0d,0d); the Duplicate command works OK, but neither object rotates. Any ideas? thanks Steve Quote Link to comment
Jason33 Posted February 11, 2003 Share Posted February 11, 2003 hello, the Rotate3D procedure is looking for real numbers only withouth the ds. e.g. Rotate3D(90,0,0); -jason Quote Link to comment
Steve Cox Posted February 12, 2003 Author Share Posted February 12, 2003 Thanks Jason, I tried removing the 'd's , now using Duplicate (0,120); Rotate3D (-90,0,0); but it's made no difference. Quote Link to comment
Jason33 Posted February 12, 2003 Share Posted February 12, 2003 hello, I'm not sure why it's not working. here is a small script which is working on my machine. you may need to give the rotate command before the duplicate, so there is no confusion as to what object is to be rotated. PROCEDURE Rotate; BEGIN Beginxtrd(0,1); Rect(0,2,2,0); EndXtrd; Rotate3d(-90,0,0); Duplicate(2,2); END; RUN(Rotate); i hope THIS helps. -jason Quote Link to comment
Steve Cox Posted February 13, 2003 Author Share Posted February 13, 2003 Jason, thanks for that. I tried your script, and after a lot of tweaking came up with this one. PROCEDURE Rotate3; BEGIN Beginxtrd(0,6); {draw shape} Rect(0,0,2,1); EndXtrd; Duplicate(6,0); Rotate3d(-90,0,0); Duplicate(6,0); Rotate3d(0,0,90); END; RUN(Rotate3); This seems to always rotate the first shape, but duplicates the duplicate, so I think I am not selecting the right object to rotate. When I work out how to do that I may have got it sorted. Then I tried this, to duplicate and rotate the selected object in the drawing. PROCEDURE Rotate4; BEGIN Duplicate(6,0); Rotate3d(-90,0,0); Duplicate(6,0); Rotate3d(0,0,90); END; RUN(Rotate4); This doesn't rotate any shape, but duplicates the original OK All I was trying to do was generate 3rd angle views of an object in my drawing. Perhaps as a non-programmer I should have stuck to the simple method. :-) Steve Quote Link to comment
Jason33 Posted February 14, 2003 Share Posted February 14, 2003 hello steve, here's the deal. the Rotate3D works on the last created object, and the Duplicate works on all selected objects. to make matters more complicated, the computer does not recognize duplicated objects as new objects. here's a script that i think will solve your problem. PROCEDURE Rotate5; VAR h:HANDLE; BEGIN BeginXtrd(0,1); Rect(0,2,2,0); EndXtrd; h:=LnewObj; Rotate3D(45,0,0); {Rotate 1st then duplicate then rotate back} Duplicate(4,0); Rotate3D(-45,0,0); {the following allows the process to be repeated without the above duplicate being duplicated again.} DSelectall; SetSelect(h); {Second Duplication} Rotate3D(0,-45,0); Duplicate(-4,0); Rotate3D(0,-45,0); DSelectall; SetSelect(h); {repeat if needed} END; RUN(Rotate5); I hope this helps. -jason Quote Link to comment
Jason33 Posted February 14, 2003 Share Posted February 14, 2003 correction to above second duplication should read: {Second Duplication} Rotate3D(0,-45,0); Duplicate(-4,0); Rotate3D(0,45,0); DSelectall; to rotate the original back into position. -jason Quote Link to comment
Steve Cox Posted February 14, 2003 Author Share Posted February 14, 2003 Thanks Jason. I got your script working fine. Now I just need to convert it to work on the selected object in the drawing and I'm done. Thanks for all your help Steve Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.