Tetsuo Posted June 27, 2011 Share Posted June 27, 2011 Hi all, I'm looking for a automatisation for multi offset. I have a polyline and i have to offset this polyline to multi distance... For exemple : an offset to 20 than an offset to 35 and than an offset to 56 (allways offset of the source line) Is it possible to create a lisp or something likethat (macro,...) with in i can enter the different value and then when I click the line and the direction the script offset the line to all the value... Thx (and sorry for my bad english :-) ) Quote Link to comment Share on other sites More sharing options...
ketxu Posted June 27, 2011 Share Posted June 27, 2011 You mention about PLine or Line ??? Quote Link to comment Share on other sites More sharing options...
dbroada Posted June 27, 2011 Share Posted June 27, 2011 there used to be a setting that would allow you to stay in the same command for as long as you want which would probably do what you need here. However, I think the command was REPEAT which has been discontinued. As you are using an older release you could give it a try, it may still be available to you. Quote Link to comment Share on other sites More sharing options...
Tetsuo Posted June 27, 2011 Author Share Posted June 27, 2011 Well, I'm talking about polyline sorry. Here's a code that works fine... But now i'd like to put a negative value ... for exemple changing the ed var from 15 to -15 ... so that the line offset the other side... (defun C:dof() (setq ad 9) (setq zd 10) (setq ed 15) (while (setq obj (car (entsel "\nSelect object:"))) (setq ps (getpoint "\nSide to offset:")) (if ps (progn (command "_offset" ad obj ps "") (command "_offset" zd obj ps "") (command "_offset" ed obj ps "") ) ) ) (princ) ) don't know if it's possible Quote Link to comment Share on other sites More sharing options...
Frank Hull Posted June 27, 2011 Share Posted June 27, 2011 You might consider using mlines. Create a multi-line style with your offset values pre-set. An mline will explode to a set of standard lines. Quote Link to comment Share on other sites More sharing options...
Tetsuo Posted June 27, 2011 Author Share Posted June 27, 2011 Yes but I must start from a polyline... Is it possible to convert polyligne to multiline and then a multiline to polyline... the purpose of this manip is to convert an existing draw to multiple path for cnc tools. Of as I said before is there a solution for negative value offset Quote Link to comment Share on other sites More sharing options...
Tetsuo Posted June 27, 2011 Author Share Posted June 27, 2011 Alright, here is what I do (defun C:dof() (setq ad 9) (setq zd 10) (setq ed 15) (while (setq obj (car (entsel "\nSelect object:"))) (setq psp (getpoint "\nSide to offset positif:")) (setq psn (getpoint "\nSide to offset negatif:")) (if psp (progn (command "_offset" ad obj psp "") (command "_offset" zd obj psp "") (command "_offset" ed obj psn "") ) ) ) (princ) ) I defin 2 point for the offsets ... one positif (psp) and a negative one (psn). On more click but it works fine... My last question : Anyone can tell me how can i put each of my offset line in a specific layer...? Quote Link to comment Share on other sites More sharing options...
Tharwat Posted June 27, 2011 Share Posted June 27, 2011 Perhaps ... ? (defun c:test (/ ss e p d) (if (and (setq ss (car (entsel "\n Select on entity [Line,Spline,Polyline] :") ) ) (member (cdr (assoc 0 (setq e (entget ss)))) '("LINE" "SPLINE" "LWPOLYLINE") ) (setq p (getpoint "\n Specify side offset :")) ) (while (setq d (getdist "\n Specify offset distance :")) (command "_.offset" d ss p "") ) (princ) ) (princ) ) Tharwat Quote Link to comment Share on other sites More sharing options...
ketxu Posted June 27, 2011 Share Posted June 27, 2011 - Oh, now i understand what did you mean ^^ You can use vla-offset to offset with negative distance (but sometimes it doesn't like what you want to do ^^). syntax : vla-offset vlaLine distance So you can try sth like that (just for show ^^) : (defun C:dof(/ lstDis obj) (setq lstDIS '(9 10 -15)) (while (setq obj (car (entsel "\nSelect object:"))) (foreach dis lstDIS (vla-offset (vlax-ename->vla-object obj) dis) ) ) (princ) ) -Next : in your code, you can put each *Line in a specific layer with (setvar "clayer" "your layer here") before one command Quote Link to comment Share on other sites More sharing options...
alanjt Posted June 27, 2011 Share Posted June 27, 2011 You could do a little subroutine and build from it... (defun _offsetLots (entity point offsetlist) (foreach offset offsetlist (command "_.offset" offset entity "_non" point "")) ) call with: (_offsetLots (entsel) (getpoint) '(1. 2. 3. 4. 5.)) Quote Link to comment Share on other sites More sharing options...
BIGAL Posted June 28, 2011 Share Posted June 28, 2011 Maybe also a dotted pair offset and layer name as list (1 . lay1)(2 . lay2) and so on asked above for different layers. 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.