Tharwat Posted June 4, 2018 Posted June 4, 2018 (defun c:Test (/ pt1 pt2 pt3 ang) ;; Tharwat - 04.Jun.2016 ;; (or *offdist* (setq *offdist* 0.1)) (initget 6) (if (setq *offdist* (cond ((getdist (strcat "\nSpecify *offdist*set distance " (strcat "< " (rtos *offdist* 2 2) " > :") ) ) ) (*offdist*) ) ) (while (and (setq pt1 (getpoint "\n1st point :")) (setq pt2 (getpoint "\n2nd point :" pt1)) (setq pt3 (getpoint "\nSpecify offset side :")) (setq ang (angle pt1 pt2)) ) (setq ang ((if (minusp (sin (- ang (angle pt2 pt3)))) + - ) ang (* pi 0.5) ) ) (entmakex (list '(0 . "LINE") (cons 10 (trans (polar pt1 ang *offdist*) 1 0)) (cons 11 (trans (polar pt2 ang *offdist*) 1 0)) ) ) ) ) (princ) ) Quote
Scoutr4 Posted July 7, 2022 Posted July 7, 2022 (defun c:Test (/ pt1 pt2 pt3 ang) ;; Tharwat - 04.Jun.2016 ;; (or *offdist* (setq *offdist* 0.1)) (initget 6) (if (setq *offdist* (cond ((getdist (strcat "\nSpecify *offdist*set distance " (strcat "< " (rtos *offdist* 2 2) " > :") ) ) ) (*offdist*) ) ) (while (and (setq pt1 (getpoint "\n1st point :")) (setq pt2 (getpoint "\n2nd point :" pt1)) (setq pt3 (getpoint "\nSpecify offset side :")) (setq ang (angle pt1 pt2)) ) (setq ang ((if (minusp (sin (- ang (angle pt2 pt3)))) + - ) ang (* pi 0.5) ) ) (entmakex (list '(0 . "LINE") (cons 10 (trans (polar pt1 ang *offdist*) 1 0)) (cons 11 (trans (polar pt2 ang *offdist*) 1 0)) ) ) ) ) (princ) ) Can you add what it will look like and on which side it will be before you draw the line? Like the offset command. Quote
Tharwat Posted July 7, 2022 Posted July 7, 2022 5 minutes ago, Scoutr4 said: Can you add what it will look like and on which side it will be before you draw the line? Like the offset command. That's what it does currently but after specifying the two points that represents the assumed line 1 Quote
Scoutr4 Posted July 7, 2022 Posted July 7, 2022 I am using Autocad 2022 version but As you said, after selecting 2 points, it doesn't show me a sampling of which side it will be on. I tried to add gif but failed. That's why I uploaded it as a link. https://imgur.com/a/eBCBEGy Quote
Tharwat Posted July 7, 2022 Posted July 7, 2022 You can add the grdraw function to create a rubber band for a better review before specifying the side point like this: (setq pt2 (getpoint "\n2nd point :" pt1)) (not (grdraw pt1 pt2 2)) ;; this expression (setq pt3 (getpoint "\nSpecify offset side :")) 1 Quote
Scoutr4 Posted July 7, 2022 Posted July 7, 2022 (edited) Thanks but I wanted to see the newly drawn line. Can you show me the sampling as if the pt3 point was selected without the pt3 point selected? This way i can see if it is in the range i want. Then I can choose pt3 and finish the process. Edited August 8, 2022 by Scoutr4 I'm editing the post because for the first time I was a newbie to explain my problem. 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.