Welcome,
Guest
. Please
login
or
register
.
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
News:
Home
Help
Login
Register
TheSwamp
»
Code Red
»
AutoLISP (Vanilla / Visual)
»
Topic:
Updating a layer's modified xData - "AcCmTransparency" to be specific.
« previous
next »
Print
Pages: [
1
] |
Go Down
Author
Topic: Updating a layer's modified xData - "AcCmTransparency" to be specific. (Read 983 times)
0 Members and 1 Guest are viewing this topic.
Rustabout
Newt
Posts: 135
Updating a layer's modified xData - "AcCmTransparency" to be specific.
«
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]
(
setq
hostLayer
(
vla-item
(
vla-get-layers
(
vla-get-activeDocument
(
vlax-get-acad-object
)
)
)
"XXX - HOST LAYER"
)
)
(
vla-getxData
hostLayer
"AcCmTransparency"
'xTypeHost 'xDataHost
)
(
setq
targetLayer
(
vla-item
(
vla-get-layers
(
vla-get-activeDocument
(
vlax-get-acad-object
)
)
)
"XXX - TARGET LAYER"
)
)
(
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
Logged
Lee Mac
Seagull
Posts: 12926
London, England
WWW
Re: Updating a layer's modified xData - "AcCmTransparency" to be specific.
«
Reply #1 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.
Logged
Lee Mac Programming
•
Twitter
•
Exchange App Store
BIGAL
Swamp Rat
Posts: 1433
40 + years of using Autocad
Re: Updating a layer's modified xData - "AcCmTransparency" to be specific.
«
Reply #2 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
Logged
A man who never made a mistake never made anything
Rustabout
Newt
Posts: 135
Re: Updating a layer's modified xData - "AcCmTransparency" to be specific.
«
Reply #3 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!
Logged
Print
Pages: [
1
] |
Go Up
« previous
next »
TheSwamp
»
Code Red
»
AutoLISP (Vanilla / Visual)
»
Topic:
Updating a layer's modified xData - "AcCmTransparency" to be specific.