Glen1980 Posted March 16, 2012 Posted March 16, 2012 Currently I am working on a building that is roughly bannana shaped. I am still at the early design stage so doors and windows are moving regularly. The radius of the building is about 60m so I am having fun rotating the doors to keep them in the correct plane especially as I am exhausted these days and my brain really isn't keeping up. At the moment I start the rotate command then select the door or seperating wall that runs perpendicular to the round walls, then I select the centre point of the round wall as the base point then select reference point re-select the centre point then the middle of the door or the wall so I can see where I am moving the elements to. As I am trying to learn LISP I thought I'd have a go at one that will start the rotate command, then automatically start the reference variable selecting the rotate basepoint as the first reference point. SO far I have (defun C:ref () ;Reference Rotates with centre point & 1st ref the same ***** (setq oldsnap (getvar "osmode")) ;Saving Snaps (setvar "osmode" 4) ;Set Centre of circle to osnap ***** Get Points (setq cp (getpoint "\nCentre of Circle : ")) ;Set centerpoint and first reference point (setvar "osmode" 32) Snaps on (setq rp (getpoint "\nReference point : ")) ;Set Second reference point (setq np (getpoint "\nSelect new position : ")) ;select new position ****** ;Start of command functions (command "rotate" ( ) cp cp rp np) ;Start rotate command ****** (setvar "osmode" oldsnap) ;Reset snaps ) ;End of function I am now wondering how to select the bits I want to rotate then tell the roatate command I want to use reference points. Also I would like to add a bit of code to give me the option of starting the copy function. Could someone please give me some HINTS on how to do these thing. Also constructive critisisms of code more than welcome. This is more of a learning exercise than something I'll use a lot so the effort writing the LISP won't pay off (aside for all of that lovely knowledge) Quote
pBe Posted March 16, 2012 Posted March 16, 2012 (defun c:test nil (vl-cmdf "_rotate" (ssget) "" "_cen" (getpoint "\nPick Center point: ") "r" "_non" (getvar 'LastPoint) "_non" (getpoint "\nPick Reference point: ") pause ) ) 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.