# OFFSET WITH 20% OF MEASURED DISTANCE.

• 2014-06-05, 11:47 AM
aijazahmed
OFFSET WITH 20% OF MEASURED DISTANCE.
Dear All,

I am looking for code with following steps

1) Select object to Offset
2) pick point P1 & P2 for offset distance
3) Pick Point on Side to Offset

and with step 2 I need offset distance 20% of distance between p1 & p2.
any help will be much appreciate.

Thanks,
• 2014-06-05, 12:12 PM
Tharwat
Re: OFFSET WITH 20% OF MEASURED DISTANCE.
Try this .

Code:

```(defun c:Test (/ 1p 2p o s)   ;;    Tharwat 05.June.2014        ;;   (if (and (setq 1p (getpoint "\n Specify first point :"))           (setq 2p (getpoint "\n Specify second point :" 1p))           (setq o (/ (distance 1p 2p) 5.))       )     (while (setq s (ssget "_+.:S:L" '((0 . "*LINE,CIRCLE,ARC,ELLIPSE"))))       (command "_.offset" o s pause "")     )   )   (princ) )```
• 2014-06-05, 04:05 PM
aijazahmed
Re: OFFSET WITH 20% OF MEASURED DISTANCE.
Thank you so much Mr. Tharwat,
Exactly i was needed same

Thanks.

Quote:

Try this .

Code:

```(defun c:Test (/ 1p 2p o s)   ;;    Tharwat 05.June.2014        ;;   (if (and (setq 1p (getpoint "\n Specify first point :"))           (setq 2p (getpoint "\n Specify second point :" 1p))           (setq o (/ (distance 1p 2p) 5.))       )     (while (setq s (ssget "_+.:S:L" '((0 . "*LINE,CIRCLE,ARC,ELLIPSE"))))       (command "_.offset" o s pause "")     )   )   (princ) )```

• 2014-06-05, 04:12 PM
Tharwat
Re: OFFSET WITH 20% OF MEASURED DISTANCE.
Quote:

Thank you so much Mr. Tharwat,
Exactly i was needed same

Thanks.

You're welcome :)