Author Topic: Update lineweight property  (Read 1383 times)

0 Members and 1 Guest are viewing this topic.

w64bit

  • Newt
  • Posts: 78
Update lineweight property
« on: July 27, 2020, 06:52:19 AM »
In a lisp I found for changing content of blocks to:
- layer 0
- color ByBlock
I need to add the code for changing also the lineweight to ByLayer.
Tried to change 6 to 370 in the following part, but with no luck:
Code: [Select]
        (if (assoc 6 lSubData)
          (progn
            (setq lSubData
                   (subst
                     (cons 6 "BYBLOCK")
                     (assoc 6 lSubData)
                     lSubData
                   ) ;_ end subst
            ) ;_ end setq
            (entmod lSubData)
          ) ;_ end progn
          (entmod (append lSubData (list (cons 6 "BYBLOCK"))))
        ) ;_ end if
Can anyone help?

d2010

  • Bull Frog
  • Posts: 323
Re: Update lineweight property
« Reply #1 on: July 27, 2020, 09:50:10 AM »
Can anyone help?
Can you test this program? You execute with command BYL[enter] at line command.
My programe autoxchw.lsp Change to BYLayer , all entities inside Blocsk.I do not have Drawing.dwg with Blocks + manycolors-inside
« Last Edit: July 29, 2020, 12:06:36 PM by d2010 »

ribarm

  • Gator
  • Posts: 3225
  • Marko Ribar, architect
Re: Update lineweight property
« Reply #2 on: July 27, 2020, 09:56:40 AM »
If you want to set Lineweight to ByLayer, you should set DXF 370 to -1...
If you want ByBlock => (370 . -2)
If you want Default => (370 . -3)
And if you want millimeters => (370 . x) and x=(0 5 9 13 15 18 20 25 30 35 40 50 53 60  70 80 90 100 106 120 140 158 200 211)

Note - once added DXF 370, can't be removed like '(66 . 1) - block with attributes, so if not present I'd leave DXF data unchanged, but if (assoc 370 (entget ent)) => (entupd (cdr (assoc -1 (entmod (subst '(370 . x) (assoc 370 (entget ent)) (entget ent))))))
x - you'll have to choose...

[EDIT : I was wrong for my note... I've changed lineweight to some value, then (entupd (cdr (assoc -1 (entmod (subst '(370 . -1) (assoc 370 (entget ent)) (entget ent)))))) and miraculously DXF 370 disappeared...]
« Last Edit: July 27, 2020, 11:10:27 AM by ribarm »
Marko Ribar, d.i.a. (graduated engineer of architecture)

:)

M.R. on Youtube

w64bit

  • Newt
  • Posts: 78
Re: Update lineweight property
« Reply #3 on: July 27, 2020, 11:42:13 AM »
Thank you all very much.