MastroLube Posted August 24, 2016 Posted August 24, 2016 Hello everyone, just a little question.. I've to entmod an entity but it has a lot of parameters. ((-1 . <Nome entità: 7ff5ff013970>) (0 . "XRECORD") (5 . "57F") (102 . "{ACAD_REACTORS") (330 . <Nome entità: 7ff5ff00a2e0>) (102 . "}") (330 . <Nome entità: 7ff5ff00a2e0>) (100 . "AcDbXrecord") (280 . 1) (90 . 4) (90 . 7) (1 . "568") (1 . "") (290 . 0) (40 . 0.0) (290 . 0) (290 . 1) (290 . 0) (290 . 1) (290 . 0) (290 . 0) (290 . 0) (290 . 0) (290 . 1) (40 . 0.0) (70 . 9) (70 . 0) (70 . 4) (70 . 3) (70 . 3) (70 . 253) (70 . 1) (40 . 1.6) (40 . 1.6) (40 . 0.0) (40 . 1.0) (1 . "CB_Richiami") (1 . "ACA_1") (1 . "ACA_1") (1 . "") (1 . "") (1 . "") (40 . 1.0) (290 . 1) (40 . 0.899037) (40 . 100.0) (40 . 0.5) (40 . 1.0) (1 . "1") (1 . "") (1 . "") (1 . "") (1 . "") (40 . 1.0) (290 . 1) (290 . 1) (40 . 95.0) (40 . 20.0) (70 . 0) (40 . 0.0) (40 . 0.0) (40 . 0.0) (40 . 0.0) (40 . 0.0) (1 . "") (40 . 0.0) (40 . 0.0) (40 . 0.5) (40 . 1.25) (40 . 0.0) (40 . 0.0) (70 . -1) (70 . 1) (40 . 1.4) (1 . "ACA_1") (1 . "") (290 . 1) (70 . 1) (290 . 1) (290 . 0) (1 . "") (40 . 0.0) (40 . 0.0) (290 . 0) (70 . -1) (290 . 1) (1 . "{IdBlocchiEstreminta") (1 . "56A") (1 . "56B") (1 . "IdBlocchiEstreminta}") (1 . "{IdTxtEtichetta") (1 . "56C") (1 . "56E") (1 . "56D") (1 . "574") (1 . "573") (1 . "IdTxtEtichetta}") (1 . "{IdTxtCampiSerieBarre") (1 . "56C") (1 . "IdTxtCampiSerieBarre}") (1 . "{PuntiPolilinea") (1 . "PuntiPolilinea}") (1 . "569") (1 . "575") (70 . 1) ) For example if i want to change the 4th dxf group (40 . x) what should I do? (setq quota (subst (cons 40 0.5)(assoc 40 quota) quota)) (entmod quota) my code works only with the 1st one.. Thanks Dennis Quote
Lee Mac Posted August 24, 2016 Posted August 24, 2016 Here's one possible way: (setq cnt 0) (entmod (mapcar (function (lambda ( itm ) (if (and (= 40 (car itm)) (= 4 (setq cnt (1+ cnt)))) '(40 . 0.5) itm ) ) ) quota ) ) Quote
MastroLube Posted August 25, 2016 Author Posted August 25, 2016 thank you Mr. Lee! you're the best Quote
Roy_043 Posted August 25, 2016 Posted August 25, 2016 AFAIK you cannot 'entmod' an xrecord. See here. 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.