Jump to content

offset polyline


MR MAN

Recommended Posts

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.

Link to comment
Share on other sites

  • 2 weeks later...

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...