Author Topic: Updating a layer's modified xData - "AcCmTransparency" to be specific.  (Read 904 times)

0 Members and 1 Guest are viewing this topic.

Rustabout

  • Newt
  • Posts: 135
I've found a way to update Layer Transparency using only Visual LISP and the vla-setXdata command. Only problem is that my layer transparency won't update unless I close and reopen my file.

Code - Auto/Visual Lisp: [Select]
  1.     (setq hostLayer (vla-item (vla-get-layers (vla-get-activeDocument (vlax-get-acad-object))) "XXX - HOST LAYER" ))
  2.  
  3.     (vla-getxData hostLayer "AcCmTransparency" 'xTypeHost 'xDataHost)
  4.  
  5.     (setq targetLayer (vla-item (vla-get-layers (vla-get-activeDocument (vlax-get-acad-object))) "XXX - TARGET LAYER" ))
  6.  
  7.     (vla-setxdata targetLayer xTypeHost xDataHost)


Any ideas?

Note that I am avoiding working with the dxf codes both for simplicity and unfamiliarity with 'em. Would like to maintain that if I can. The advantage I have here is that I only need to copy the xdata and then apply it to a newly created layer

Lee Mac

  • Seagull
  • Posts: 12906
  • London, England
This thread may be of some assistance -
https://www.theswamp.org/index.php?topic=52473

Though, if I recall, I don't think it is possible to force the display to update without closing & opening the file.

BIGAL

  • Swamp Rat
  • Posts: 1398
  • 40 + years of using Autocad
A man who never made a mistake never made anything

Rustabout

  • Newt
  • Posts: 135
Opening and closing the drawing won't be the worst thing on earth.

I'll play around with vla-update none the less.

Thanks for the feeback guys!