KRBeckman Posted February 15, 2010 Share Posted February 15, 2010 Yeah it is, but the I wasn't getting the answer I was looking for, so I did some more digging and found this one and was hoping to get closer to the solution. I guess looking back I should have just referenced this post in the other one, sorry rookie mistake. Quote Link to comment Share on other sites More sharing options...
KRBeckman Posted February 17, 2010 Share Posted February 17, 2010 Try in command line: Click polyline to get DXF list: Command: (setq plDxf(entget(car(entsel)))) Select object: ((-1 . <Entity name: 7efa3368>) (0 . "LWPOLYLINE") (330 . <Entity name: 7efa1cf8>) (5 . "1AD") (100 . "AcDbEntity") (67 . 0) (410 . "Model") (8 . "0") (100 . "AcDbPolyline") (90 . 4) (70 . 0) (43 . 0.0) (38 . 0.0) (39 . 0.0) (10 0.0 0.0) (40 . 0.0) (41 . 0.0) (42 . 0.0) (10 10.0 0.0) (40 . 0.0) (41 . 0.0) (42 . 0.0) (10 10.0 10.0) (40 . 0.0) (41 . 0.0) (42 . 0.0) (10 0.0 10.0) (40 . 0.0) (41 . 0.0) (42 . 0.0) (210 0.0 0.0 1.0)) Remove all non 10 groups: Command: (setq lst10(vl-remove-if '(lambda(x)(/= 10(car x)))plDxf)) ((10 0.0 0.0) (10 10.0 0.0) (10 10.0 10.0) (10 0.0 10.0)) Remove first member of each list" Command: (setq verLst(mapcar 'cdr lst10)) ((0.0 0.0) (10.0 0.0) (10.0 10.0) (0.0 10.0)) Or at once: Command: (mapcar 'cdr(vl-remove-if '(lambda(x)(/= 10(car x)))(entget(car(entsel))))) ((0.0 0.0) (10.0 0.0) (10.0 10.0) (0.0 10.0)) How would I change this last line of code to automattically select the last polyline drawn? Quote Link to comment Share on other sites More sharing options...
CAB Posted February 17, 2010 Share Posted February 17, 2010 (ssname (ssget "_X" (list (cons 0 "LWPOLYLINE"))) 0) Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted February 17, 2010 Author Share Posted February 17, 2010 You can get at the last entity entered into the drawing database using entlast. Quote Link to comment Share on other sites More sharing options...
KRBeckman Posted February 17, 2010 Share Posted February 17, 2010 (ssname (ssget "_X" (list (cons 0 "LWPOLYLINE"))) 0) Replace "entsel" with this? Quote Link to comment Share on other sites More sharing options...
KRBeckman Posted February 17, 2010 Share Posted February 17, 2010 You can get at the last entity entered into the drawing database using entlast. Do I replace "entsel" with "entlast", or use: entsel(entlast) ? Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted February 17, 2010 Author Share Posted February 17, 2010 Replace (car (entsel)) With (entlast) Or the code that CAB kindly provided. Look up the entlast function in the Help files - you will see that it returns an ename (if successful), whereas entsel returns a list, therefore we can conclude that the 'car' must be replaced also, as we are not dealing with a list. Quote Link to comment Share on other sites More sharing options...
KRBeckman Posted February 17, 2010 Share Posted February 17, 2010 Thanks a ton guys, really appriciate your help!!! Quote Link to comment Share on other sites More sharing options...
CAB Posted February 17, 2010 Share Posted February 17, 2010 Use this (mapcar 'cdr(vl-remove-if '(lambda(x)(/= 10(car x)))(ssname (ssget "_X" (list (cons 0 "LWPOLYLINE"))) 0))) Problem with (entlast) is that the last entity may not be a LWPolyline. Unless you just created it. The example I posted would bomb if there are no LWPolylines in the DWG. Quote Link to comment Share on other sites More sharing options...
leo321 Posted November 9, 2017 Share Posted November 9, 2017 Want change this! (defun C:LP(/ PNT1 P1X P1Y STDY DY COORDN COORDE PTXT) (setq PNT1 (getpoint "\nPick coordinate point: ")) (setq P1X (car pnt1)) ;x coord (setq P1Y (cadr pnt1)) ;y coord (setq STDX (rtos P1X 2 2)) (setq STDY (rtos P1Y 2 2)) (setq COORDN (strcat "N=" STDY )) (setq COORDE (strcat "E= " STDX )) (setq PTXT (getpoint "\nPick text location: ")) (command "LEADER" PNT1 PTXT "" COORDN COORDE "") (princ) ) now print this N=8566159.79 E= 505422.47 wanted this way N=8.566.159,79 E= 505.422,47 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.