isutheparambil Posted August 15, 2017 Posted August 15, 2017 Hi, I am looking for a lisp that can convert MULTILINE to a single PLINE. The lisp that converting the same MULTILINE to 2 PLINE already I found from the attached post. But I need that multi line in to a single pline-NOT double pline. If someone have any idea, please share with me... :) Quote
ReMark Posted August 15, 2017 Posted August 15, 2017 So the end result is a single polyline with a width that mimics what the distance between the two multilines is? Quote
isutheparambil Posted August 15, 2017 Author Posted August 15, 2017 That can be varies as per drawings.. suppose MLINE means a pipe, So the pipe dia should be varies... Quote
ReMark Posted August 15, 2017 Posted August 15, 2017 Notice I did not specify a "set" width. So basically the answer to my question is "yes" then. Correct? Quote
isutheparambil Posted August 15, 2017 Author Posted August 15, 2017 (edited) Hope you got me.... Edited August 15, 2017 by isutheparambil Quote
BIGAL Posted August 16, 2017 Posted August 16, 2017 (edited) Remark looks like original centreline of mline, not sure what "co-ords" of mline gives also need to check top, bottom and zero. ; converts mline to pline note uses mline vertices does not take ; into account top or bottom offset ; By Alan H Aug 2017 (defun c:test ( / co-ords ent co-ordsxy xy oldsnap) (setq oldsnap (getvar "osmode")) (setq ss (ssget (list (cons 0 "Mline")))) ; pick only mlines (if (/= ss nil) (progn (repeat (setq x (sslength ss)) (setq ent (ssname ss (setq x (- x 1)))) ; get mlines (setq co-ords (vlax-safearray->list (vlax-variant-value (vlax-get-property (vlax-ename->vla-object ent) ; get co-ordinates of mline "Coordinates" ) ) ) ) ; convert now to a list of xy as co-ords are x y x y x y if 3d x y z x y z (setq numb (/ (length co-ords) 3)) ; mlines have a z value hence / 3 (setq I 0) (repeat numb (setq xy (list (nth i co-ords)(nth (+ I 1) co-ords) )) (setq co-ordsxy (cons xy co-ordsxy)) ; make a list of co-ordinates (setq I (+ I 3)) ) (setvar "osmode" 0) (command "_pline") (while (= (getvar "cmdactive") 1 ) (repeat (setq y (length co-ordsxy)) (command (nth (setq y (- y 1)) co-ordsxy)) ; read list of points ) (command "") ) (setq co-ordsxy nil) ; reset to do again (command "erase" ent "") ) ) ) (setvar "osmode" oldsnap) ; reset snap mode ) Edited August 17, 2017 by BIGAL Quote
isutheparambil Posted August 16, 2017 Author Posted August 16, 2017 BIGAL, That was great and quite nice. Still there is a problem existing that..... 1. MLINE still existing (the MLINE i need to delete) 2. The newly created PLINE that is not the center line of MLINE.(in this case I am looking the cener line of MLINE as a PLINE, and the base MLINE shoulld be replaced with new PLINE) Hope you got my requirements.:) Quote
BIGAL Posted August 16, 2017 Posted August 16, 2017 Erase added to code, top or bottom makes it a bit harder. Quote
isutheparambil Posted August 16, 2017 Author Posted August 16, 2017 (edited) Anyway the MLINE contains odd numbers like 3,5,7,9....etc.. Mlines, it will take the center line as a PLINE.( But not with the even numbers). As you mention, if Delete is harder to add with, then easly can delete the remain MLINE by Erase command with a 'select similar' option. Thanks all of you for a good support:D:D:D Edited August 16, 2017 by isutheparambil Quote
SLW210 Posted August 16, 2017 Posted August 16, 2017 I have moved your thread to the AutoLISP, Visual LISP & DCL Forum. Quote
BIGAL Posted August 17, 2017 Posted August 17, 2017 Top or bottom refers to a mline being to the left or right offset. But the code will put the pline on the left or right not in middle when Top or Bot is used. Quote
isutheparambil Posted August 17, 2017 Author Posted August 17, 2017 Yes BIGAL, You are right. But the one which created finally that was not able to select by a window or cross window, but by a single click only. Any way both programs are very helpful for me. I request you to one thing that can possible with a selection by cross window or widow instead the one working with the single click selection is much appreciate and more helpful even that PLINE is not assigned to middle also. Thanks for all again..:) Quote
BIGAL Posted August 17, 2017 Posted August 17, 2017 Check the post above it will do multiple I have not used any specific selection method other than must be a mline. Quote
isutheparambil Posted August 17, 2017 Author Posted August 17, 2017 BIGAL, Thank you so much.... That was great.... That what i need..:D:D The result PLINE which taking the justification of MLINE..:):D:D Really nice.... I really appreciate you... Thanks a lot BIGAL....8)8) Quote
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.