Tharwat Posted July 23, 2014 Posted July 23, 2014 Without Vlisp . (mapcar '(lambda (x) (if (eq (car x) 10) (setq l (cons (list (cadr x) (caddr x)) l)) ) ) (entget s) ) Quote
samifox Posted July 23, 2014 Author Posted July 23, 2014 What is the different between yr code and the code in the prevuos post? Quote
Tharwat Posted July 23, 2014 Posted July 23, 2014 What is the different between yr code and the code in the prevuos post? Did not you try them each one alone ? What did you find out ? Quote
samifox Posted July 23, 2014 Author Posted July 23, 2014 Im not in front of pc but by reading i guss that ur code in the other one is about the same Quote
Tharwat Posted July 23, 2014 Posted July 23, 2014 Im not in front of pc but by reading i guss that ur code in the other one is about the same Yes , and as I said before it is without VLisp function(s) . Quote
Lee Mac Posted July 23, 2014 Posted July 23, 2014 Another: (apply 'append (mapcar '(lambda ( x ) (if (= 10 (car x)) (list (cdr x)))) (entget <lwpolyline-entity>))) Quote
hanhphuc Posted July 24, 2014 Posted July 24, 2014 (edited) Yes , and as I said before it is without VLisp function(s) . sorry my for old post VL, some vl- vlax- functions also not need (vl-load-com) that's why i was confused now i re-post this without VL. (setq e (car(entsel))) ;select LWPOLYLINE ('((l / i j) (while l (if (setq i (assoc 10 l)) (setq j (cons (cdr i) j)) ) (setq l (cdr l)) ) j ) (entget e) ; <-- e= ename of LWPOLY ) ;wrapped in lambda due to localize i & j variables another ('((l / i) (cdr (foreach x (mapcar 'cdr l) (if (listp x) (setq i (cons x i)) ) ) ) ) (entget e) ) as far i know (vl-load-com) for collections documents? @David it was fun learning Thank you Edited July 24, 2014 by hanhphuc Quote
martinle Posted February 16, 2018 Posted February 16, 2018 Hello I found these threads. I have a job to do. At the selected vertex of a closed polyline, I must place a vertical xline at both endpoints. In the thread, I can only address all key points. But I only need the selected vertex of the polyline. Please help Thank you Martin Quote
pBe Posted February 16, 2018 Posted February 16, 2018 Hello... At the selected vertex of a closed polyline, .. But I only need the selected vertex of the polyline. I think you meant endpoints of a selected "segment"? Is the no Vlisp rule applies to your request? Quote
pBe Posted February 16, 2018 Posted February 16, 2018 Hello pBe Yes Yes on both counts? "segment" and "No Vlisp rule"? Quote
martinle Posted February 16, 2018 Posted February 16, 2018 Hello pBe I Click on a segment of the polyline and need the endpoints to the left and right of the click point. Thank you Martin Quote
pBe Posted February 16, 2018 Posted February 16, 2018 (edited) Quick Mod (Defun c:demo (/ en param) (setq en (entsel)) (setq param (vlax-curve-getParamAtPoint (Car en) (vlax-curve-getclosestpointto (Car en) [color="blue"](trans (cadr en) 1 0)[/color]) ) ) (foreach pt (mapcar '(lambda (p) [color="blue"](trans [/color](vlax-curve-getPointAtParam (Car en) p)[color="blue"] 1 0)[/color] ) (list (fix param) (1+ (fix param))) ) (entmake (list '(0 . "XLINE") '(100 . "AcDbEntity") '(100 . "AcDbXline") (cons 10 [color="blue"](trans pt 0 1)[/color]) (cons 11 (getvar "UCSYDIR")) ) ) ) (princ) ) trans function is your friend Edited February 16, 2018 by pBe UCS Friendly Quote
martinle Posted February 16, 2018 Posted February 16, 2018 Hello pBe Thanks for the quick help. It does not always work. If I work in the user UCS then only on one side an Xline is created. Martin Quote
pBe Posted February 16, 2018 Posted February 16, 2018 (edited) I'll look into it later, stepped out for lunch Code at post 33 updated Edited February 16, 2018 by pBe Quote
martinle Posted February 19, 2018 Posted February 19, 2018 Hello pBe it works. Thank you very much for your help. I have one more question: what should I change so that instead of vertical xlines horizontal xlines are set? Thank you Martin Quote
pBe Posted February 19, 2018 Posted February 19, 2018 Hello pBe...Thank you very much for your help. I have one more question: what should I change so that instead of vertical xlines horizontal xlines are set?.. Good for you (getvar "UCSYDIR") -> (getvar "UCSXDIR") 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.