MR MAN Posted December 4, 2008 Share Posted December 4, 2008 how can i offset apolyline in attachment lisp note that i want offset inside the shape? D3.LSP Quote Link to comment Share on other sites More sharing options...
matthewrussell Posted December 5, 2008 Share Posted December 5, 2008 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. Quote Link to comment Share on other sites More sharing options...
MR MAN Posted December 13, 2008 Author Share Posted December 13, 2008 thanks matthewrussell for your advise BUT it doesn't work for me any help Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted December 13, 2008 Share Posted December 13, 2008 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 Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted December 13, 2008 Share Posted December 13, 2008 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. Quote Link to comment Share on other sites More sharing options...
MR MAN Posted December 14, 2008 Author Share Posted December 14, 2008 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. Quote Link to comment Share on other sites More sharing options...
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.