Author Topic: (entmod LAYER) does not refresh layer data  (Read 2913 times)

0 Members and 1 Guest are viewing this topic.

Peter2

  • Swamp Rat
  • Posts: 656
(entmod LAYER) does not refresh layer data
« on: September 25, 2013, 04:54:36 AM »
I have a lisp where I change the line width and color of a layer and activate "lwdisplay":
Code: [Select]
(setq LD (entget (tblobjname "LAYER" freistelllayer))
                  lst_alt   (assoc 370 LD)
                  farbe_alt (assoc 62 LD)
            )
            (setq ld (subst (cons 62 freistellfarbe) (assoc 62 LD) LD))
            (entmod ld)
            (setq ld (subst (cons 370 freistelldicke) (assoc 370 LD) LD))
            (entmod ld)
            (setvar "lwdisplay" 1)
It works fine, all settings are done and displayed in the layer-dialogue. The elements on the layer changed their color and hte button for "linewidth" is pressed.

But - the elements on the modified layer are not displayed with their linewidth. I tried something -

These actions did not change anything:
Code: [Select]
regen
regenall
redraw
draw new line
"display linewidth" - on - off - on - ...
change "current linewidth" to something and draw
???

But these actions did activate the linewidth:
Code: [Select]
change the layout (model - layout - model)
click on the layer-pulldown-list
(command "_-layer" NIL)
_-layer ESCAPE
select and change something in the layer-dialogue
(setvar "clayer" (getvar "clayer"))
???

Although the last way "(setvar "clayer" (getvar "clayer"))" would solve the problem I'm not happy with it (here in .NET was a similar psoting: http://www.theswamp.org/index.php?topic=43954)

Any ideas to make it better?
« Last Edit: September 25, 2013, 05:23:27 AM by Peter2 »
Peter

AutoCAD Map 3D 2023 German (so some technical terms will be badly retranslated to English)
BricsCAD V23

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: (entmod LAYER) does not refresh layer data
« Reply #1 on: September 25, 2013, 05:04:58 AM »
Peter,
What is your objection to using something like ?
Quote
(command "_-layer" nil)

The issue is caused by a deficiency in the AutoCad application and the workaround code posted seems to resolve the issue.

« Last Edit: September 25, 2013, 05:09:17 AM by Kerry »
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

Peter2

  • Swamp Rat
  • Posts: 656
Re: (entmod LAYER) does not refresh layer data
« Reply #2 on: September 25, 2013, 05:20:11 AM »
...What is your objection to using something like ?
Quote
(command "_-layer" nil)
It is a simple, brute (and maybe not correct) way to invoke and cancel the layer-command via lisp.
Sorry, I misunderstood. I did it already with "nil", but in my description above I mixed my command-line-commands and the lisp-commands. I will correct my first psot.

The issue is caused by a deficiency in the AutoCad application and the workaround code posted seems to resolve the issue.
You mean my code above?
Peter

AutoCAD Map 3D 2023 German (so some technical terms will be badly retranslated to English)
BricsCAD V23

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: (entmod LAYER) does not refresh layer data
« Reply #3 on: September 25, 2013, 05:25:14 AM »
...What is your objection to using something like ?
Quote
(command "_-layer" nil)
It is a simple, brute (and maybe not correct) way to invoke and cancel the layer-command via lisp.

The issue is caused by a deficiency in the AutoCad application and the workaround code posted seems to resolve the issue.
You mean my code above?

No, I mean the fact that the  floating layer properties palette  is not updated.


added:
simple and brute are 2 of my favourite  words.
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

GP

  • Newt
  • Posts: 83
  • Vercelli, Italy
Re: (entmod LAYER) does not refresh layer data
« Reply #4 on: September 25, 2013, 10:04:33 AM »
Try
 
Code: [Select]
    (setq lay (vla-item (vla-get-Layers (vla-get-activedocument (vlax-get-acad-object))) freistelllayer))
    (vla-put-color lay freistellfarbe)
    (vla-put-lineweight lay freistelldicke)
    (setvar "lwdisplay" 1)

Peter2

  • Swamp Rat
  • Posts: 656
Re: (entmod LAYER) does not refresh layer data
« Reply #5 on: September 25, 2013, 10:54:33 AM »
Thanks. Works fine.
Peter

AutoCAD Map 3D 2023 German (so some technical terms will be badly retranslated to English)
BricsCAD V23

GP

  • Newt
  • Posts: 83
  • Vercelli, Italy
Re: (entmod LAYER) does not refresh layer data
« Reply #6 on: September 25, 2013, 11:31:27 AM »
You're welcome
 :)

Krushert

  • Seagull
  • Posts: 13679
  • FREE BEER Tomorrow!!
Re: (entmod LAYER) does not refresh layer data
« Reply #7 on: September 25, 2013, 12:58:26 PM »
No, I mean the fact that the  floating layer properties palette  is not updated.

Ahh.  (insert light-bulb smiley here)
Explains a lot when I run MP's Create-Xref-Layer-Filter lisp. 
Thanks.
I + XI = X is true ...  ... if you change your perspective.

I no longer CAD or Model, I just hang out here picking up the empties beer cans