Jump to content
MR MAN

offset polyline

Recommended Posts

MR MAN

how can i offset apolyline in attachment lisp note that i want offset inside the shape?

D3.LSP

Share this post


Link to post
Share on other sites
matthewrussell

try adding a (setq d1) line for a distance then run the offset command in the lisp right after you have drawn the polyline.

(command "offset" (entlast) d1).

 

Maybe try something like that. You may still need to click on the inside of the object. Im still new to all this coding but try that.

Share this post


Link to post
Share on other sites
MR MAN

thanks matthewrussell for your advise BUT it doesn't work for me

 

 

any help

Share this post


Link to post
Share on other sites
Lee Mac

An example of an offset:

 

(in the words of lpseifert)

 

*Quick and Dirty*

 

(defun c:off (/ lin ent len pt pt1 pt2 dist ang)
   (setvar "cmdecho" 0)
   (princ "\nConstruct Line to Offset...")
   (command "_line" pause pause "")
   (setq lin (entlast))
   (setq ent (entget lin))
   (setq len (distance (setq pt1 (cdr (assoc 10 ent))) (setq pt2 (cdr (assoc 11 ent)))))
   (setq pt (polar pt1 (setq ang (angle pt1 pt2)) (/ len 2)))
   (setq dist (getreal "Specify Offset Distance: "))
   (command "_offset" dist lin (polar pt (+ ang (/ pi 2)) 0.01) "")
   (setvar "cmdecho" 1)
   (princ)
) ;_  end defun

Share this post


Link to post
Share on other sites
Lee Mac

In the above LISP, the constructed line is assigned to a variable using the entlast function, then the midpoint of the line is extracted - although to be honest this point can be any point on the line. - I just chose the midpoint.

 

Then the angle of the line is extracted and a point perpendicular to the line, and some distance (0.01 in this case) away from the line to one side is assigned to a variable.

 

The offset distance is retrieved using the getreal function, and then, the line variable, offset distance and perpendicular point are used in the normal ACAD offset function to offset the line.

Share this post


Link to post
Share on other sites
MR MAN

DEAR Lee Mac THANKS ALOT FOR YOUR HELP IT WORK WITH LINES BUT IT DOESN'T WORK FOR PLINES I TRY USE _PLINE COMMAND BUT IT DOESN'T WORK ALSO MY PROBLEM IS OFFSET PLINE AS SHOWN IN MY LISP

 

 

 

THANKS AGAIN.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×