p0peye Posted February 5, 2014 Posted February 5, 2014 (edited) Hi all, I have to modify and rotate assemblies very very often on a daily bases. Copy one assembly to a new location, and I have to modify it and then change the angle (I make a model for pipelines and cable-lines . Often there is a similar part with different slope for next segment.) What I do: - Select assembly parts (in Advance Steel I have a custom command assigned) - input R for rotate - select the base point for rotation - enter R for reference - select the same base rotation point as before - select second point for reference - select the new point on target line (instead of typing angle) Is there a macro or something which could allow me to - select assembly parts - start the command - pick 3 points for rotate: base point, point on start line and point on target line? It looks similar, but if I do this 100 times a day, and in a routine forget to select the second time base point or similar... I have searched (not enough, obviously) , but most of Rotate macro/lisp are for text / block - I need it for multiple objects (using Advance Steel on ACad platform). From some toppics discussing Rotate I got an impression that Macro can't do it... Thanks in advance, cheers Edited February 5, 2014 by p0peye Quote
Bhull1985 Posted February 5, 2014 Posted February 5, 2014 Seems entirely possible via lisp but we'd need to know what type of entity these objects you're wanting to modify are. Please post / upload a sample dwg if possible! Quote
p0peye Posted February 5, 2014 Author Posted February 5, 2014 Thanks for a quick reply It looks like this... (defun c:3PtRot () (setq sg (ssget)) (command "ROTATE" sg "" pause "R" "@" pause pause) ...will do it. (and it looks so simple. I was playing around and gave up ) Works for ACad lines. Will try tomorrow if the code will do the trick for AS objects, and let you know - I was just leaving the office (allmost) when I wanted to double check if there already is a solution (hate when people are laisy to even search - and there I was... - anyway - someone else might benefit... ) The lisp is NOT mine - just found it on another place... Cheers Quote
Lee Mac Posted February 5, 2014 Posted February 5, 2014 If I have understood correctly: (defun c:3pr ( / p s ) (if (and (setq s (ssget "_:L")) (setq p (getpoint "\nSpecify base point: ")) ) (vl-cmdf "_.rotate" s "" "_non" p "_r" "_non" p "\\" "\\") ) (princ) ) Quote
p0peye Posted February 6, 2014 Author Posted February 6, 2014 (edited) Hi Lee, thank you for your code. I've tried both and both are doing the great job. Just out of curiosity: do you think there is something wrong with the first code I've found on net (or at least could be done better), or you just wanted to show another approach to the problem? Thanks either way, cheers Edited February 6, 2014 by p0peye grammer Quote
SEANT Posted February 6, 2014 Posted February 6, 2014 . . . .I need it for multiple objects (using Advance Steel on ACad platform). From some toppics discussing Rotate I got an impression that Macro can't do it... Thanks in advance, cheers The two macros in this post, one for scaling, the other for rotating, allow for 3 point processing of multiple objects. It does not allow for pre-selection, however. The command macro must be initiated, then object selection. The old Verb/Noun methodology. http://www.cadtutor.net/forum/showthread.php?8142-scaling-using-object-snaps&p=46098&viewfull=1#post46098 Quote
p0peye Posted February 6, 2014 Author Posted February 6, 2014 Then again... Not that I am not grateful for offered code, but, I was thinking... Do you (or anyone else) think you could squeeze a "copy" in-front of rotate, so 1 command could do: select the objects, start Copy+3PR command, select the point as base point of copy select the point to insert objects and pivot select the point start rotate select the point for final rotate I have tried to modify the 1st code (I wouldn't know where to start with Lee's . As if I did better job with this "easier" one... )- but it just copies the selected stuff, and it ends. I am not lazy - just the know-how lacks... and free time to try to figure it out...One of the versions: (defun c:C3PR () (setq sg (ssget)) (command "COPY" sg pause "ROTATE" sg "" pause "R" "@" pause pause) ) Thank you in advance Quote
p0peye Posted February 6, 2014 Author Posted February 6, 2014 @ Seant - thanks for the reply. I have tried to figure this one by my self and I gave up. And it is not complicate, but if you mistype one character... Quote
eldon Posted February 6, 2014 Posted February 6, 2014 Have you tried the Express Tools command "Move Copy Rotate" Quote
p0peye Posted February 6, 2014 Author Posted February 6, 2014 (edited) MOCORO has some interesting options, and is applicable, but not for this problem. When Rotate is selected, it starts to measure the angle from x axe, and I need to define the starting angle... Edited February 6, 2014 by p0peye Quote
Lee Mac Posted February 6, 2014 Posted February 6, 2014 Do you (or anyone else) think you could squeeze a "copy" in-front of rotate Try this: (defun c:3pr ( / c p s ) (if (and (setq s (ssget "_:L")) (setq p (getpoint "\nSpecify base point: ")) ) (progn (if (setq c (getvar 'copymode)) (setvar 'copymode 1) ) (vl-cmdf "_.copy" s "" "_non" "0,0,0" "_non" "@" "_.move" s "" "_non" p "\\" "_.rotate" s "" "_non" "@" "_r" "_non" "@" "\\" "\\" ) (if c (setvar 'copymode c)) ) ) (princ) ) Quote
p0peye Posted February 7, 2014 Author Posted February 7, 2014 Yep. You did it again, Lee. Works like a charm. Thank you very much. Cheers, Nenad Quote
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.