Jrbuds Posted January 10, 2014 Posted January 10, 2014 Hi, I am trying to create a macro (or lisp) and am struggling to find how I would do it. Basically what I want to achieve is this: Click Custom button, Click first point (p1) Click second point (p2) Insert block at p1 and set scale to equal distance between p1 and p2 Set bearing to the bearing between p1 and p2 then end. The process will take 3 clicks including click the custom button. This is to basically speed up inserting doors. I was thinking possible making it draw a line when you click p1 and p2 then use this line to grab the start of line, end of line and bearing. Or using variables. Any help would be appreciated, or pointing in the right direction. I don't expect anyone to do all the work for me, just a hint would be awesome. Quote
Tharwat Posted January 10, 2014 Posted January 10, 2014 Welcome to CadTutor . Things like this ... ? (defun c:Test (/ bk 1p 2p) (setq bk "[color=red]BlockName[/color]") ;; Specify the name of block here . (cond ((not (tblsearch "BLOCK" bk)) (alert "\n The Block Name is not found !!") ) ((and (setq 1p (getpoint "\n Specify First point :")) (setq 2p (getpoint "\n Next point :" 1p)) ) (command "_.-insert" bk "_none" 1p (distance 1p 2p) (distance 1p 2p) (polar 1p (angle 1p (mapcar (function (lambda (q p) (* (+ p q) 0.5))) 1p 2p ) ) 1.0 ) ) ) ) (princ) ) Quote
BIGAL Posted January 10, 2014 Posted January 10, 2014 Tharwat brilliant as usual, Jrbuds only issue with a door if your showing a arc is which way is the swing you may need a extra pick saves having a left and right of every door. Quote
Tharwat Posted January 11, 2014 Posted January 11, 2014 Tharwat brilliant as usual, Jrbuds only issue with a door if your showing a arc is which way is the swing you may need a extra pick saves having a left and right of every door. Thank you Bigal for the nice words . Let's wait and see what Jrbuds wants to do with the code . Quote
BIGAL Posted January 11, 2014 Posted January 11, 2014 Jrbuds do you want walls doors window roofs etc dynamic input into 2.5D plans its commercially available very cheap prior to Acad Architectural works in standard autocad. 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.