TheSwamp

Code Red => AutoLISP (Vanilla / Visual) => Topic started by: Rustabout on May 30, 2021, 05:35:13 PM

Title: Updating a layer's modified xData - "AcCmTransparency" to be specific.
Post by: Rustabout on May 30, 2021, 05:35:13 PM
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
Title: Re: Updating a layer's modified xData - "AcCmTransparency" to be specific.
Post by: Lee Mac on May 31, 2021, 06:25:35 PM
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.
Title: Re: Updating a layer's modified xData - "AcCmTransparency" to be specific.
Post by: BIGAL on May 31, 2021, 09:48:38 PM
Maybe https://help.autodesk.com/view/ACD/2015/ENU/?guid=GUID-021BAA1C-9374-442E-801B-CB4CC93D533F

VLA-Update
Title: Re: Updating a layer's modified xData - "AcCmTransparency" to be specific.
Post by: Rustabout on June 05, 2021, 10:37:17 PM
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!