Jef! Posted April 9, 2014 Share Posted April 9, 2014 Lets say I have a line. Color dxf group code is 62, and does not exist when the color is "by layer". If I put the color to red and run that (defun c:VirtualLiquidPaper ( / ) (setq tmp (entget (car(entsel)))) (if (assoc 62 tmp) (entmod (setq tmp (vl-remove (assoc 62 tmp) tmp))) ) ) I see that tmp's value get updated, and the assoc 62 get removed from the list, but to my big surprise the entity don't get updated. What did I miss? ** I even tried to add directly after defun (shake-well-com).. not worky** Quote Link to comment Share on other sites More sharing options...
BlackBox Posted April 9, 2014 Share Posted April 9, 2014 (defun c:FOO (/ eName eData color) (if (and (setq eName (car (entsel))) (setq color (assoc 62 (setq eData (entget eName)))) ) (entmod (subst (cons 62 1) color eData)) ) (princ) ) Quote Link to comment Share on other sites More sharing options...
Jef! Posted April 9, 2014 Author Share Posted April 9, 2014 Thanks BlackBox... still not what I need tho =) I want to put it "by layer", that's why I'm trying to entmod with the elist after removing the assoc 62. Quote Link to comment Share on other sites More sharing options...
BlackBox Posted April 9, 2014 Share Posted April 9, 2014 Thanks BlackBox... still not what I need tho =)I want to put it "by layer", that's why I'm trying to entmod with the elist after removing the assoc 62. You don't need to remove the 62 grouped pair, you need only SUBSTitute it: (defun c:FOO (/ eName eData color) (if (and (setq eName (car (entsel))) (setq color (assoc 62 (setq eData (entget eName)))) ) (entmod (subst (cons 62 [color="red"]256[/color]) color eData)) ) (princ) ) ... Or perhaps: (command "._setbylayer") Quote Link to comment Share on other sites More sharing options...
Jef! Posted April 9, 2014 Author Share Posted April 9, 2014 found a way (defun c:FOO (/ eName eData color) (if (and (setq eName (car (entsel))) (setq color (assoc 62 (setq eData (entget eName)))) ) (entmod (subst (cons 62 [b]256[/b]) color eData)) ) (princ) ) After that (entget(car(entsel))) returns the list without any assoc 62. Select object: ((-1 . ) (0 . "LINE") (330 . ) (5 . "8033F") (100 . "AcDbEntity") (67 . 1) (410 . "XX") (8 . "DIM") (100 . "AcDbLine") (10 75.7625 32.3625 0.0) (11 81.2034 32.7837 0.0) (210 0.0 0.0 1.0)) Funny but worky =) thanks edit: you were faster than me. Quote Link to comment Share on other sites More sharing options...
BlackBox Posted April 9, 2014 Share Posted April 9, 2014 thanks edit: you were faster than me You're welcome; I'm happy to help. 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.