Jump to content

How to Entmod an entity if it has more dxf goup code with the same number


MastroLube

Recommended Posts

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

Link to comment
Share on other sites

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
   )
)

Link to comment
Share on other sites

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...