Hi guys, I've been away from these boards for a while now.
Anyways, I thought this would be a simple tblsearch process, but as far as I can tell, there isn't a tblsearch symbol table for vplayer settings, so I need to get more creative I guess.
I want to be able to get the vplayer color of a selected object as part of a larger routine I'm putting together. Any tips would be much appreciated.
Solved! Go to Solution.
Solved by pbejse. Go to Solution.
You can retirive it via vla-getXRecordData method, thing is values for layer overrides will give you more than just one data
colors/linetype/lineweight and so on... Also consider number of viewports with layer overrides. Layer"Sample" on one viewport might have a different value on another viewport. that will a cluster of information to sort. it will take some doing on your part.
You can use the attached file by Lee Mac as a starting point
(LM:GetOverrideData "Layername")
This may help ...
(setq ss (car (entsel "\n Select :"))) (setq e (entget ss)) (setq co (cdr (assoc 5 (entget (cdr (assoc 340 (entget (cdr (assoc 330 e)))))) ) ) )
Tharwat
pbejse,
I tried using (LM:GetOverrideData "layername") from the lisp you attached on an xref object with no overrides and it returns nil, which is fine for my purposes. Then I changed the color override to 253 and ran the routine again. Here is what it returned:
(((102 . "{ADSK_LYR_COLOR_OVERRIDE") (335 -115693792 -83283613) (420 .
-1023409923) (102 . "}")))
I see that there is data there, which tells me that it does recognize there is an override, but I don't see the color in there anywhere. In fact, I'm not sure what any of that information is, or if it is useful to me.
TharwaT313,
I tried the lisp snippet you provided under similar circumstances and got mixed results. Sometimes it would return a number like "11" or "16" which was hopeful, because that's exactly what I wanted. Unfortunately, the number never seemed to have any correlation (that I could work out) to the actual override color, which again, I had set to 253. Curiously, if I ran the routine again, it would just return ":; error: bad argument type: lentityp nil" I couldn't work out what the problem was.
If either of you guys have any insight for me it would be much appreciated. Thanks again for the suggestions.
@chalkbot wrote:pbejse,
(((102 . "{ADSK_LYR_COLOR_OVERRIDE") (335 -115693792 -83283613) (420 .
-1023409923) (102 . "}")))
I see that there is data there, which tells me that it does recognize there is an override, but I don't see the color in there anywhere. In fact, I'm not sure what any of that information is, or if it is useful to me.
335 is the viewport where the layers are overridden.
420 Is the color, need to convert it to RGB -> ACI
Use this (from Lee Mac)
(defun LM:True->RGB ( c ) (list (lsh (lsh (fix c) 8) -24) (lsh (lsh (fix c) 16) -24) (lsh (lsh (fix c) 24) -24) ) )
(last (LM:TRUE->RGB -1023409923 ))---> 253, but if you are using TrueColor thats another matter.
Like i saide before "Cluster od DATA" if there are more than one viewport with overrides. results are more data..
Check out Lee Macs website (found on his signature) for Color Conversion functions
Thanks for the acknowledgements and recommendations pbejse, appreciated
Thank you kindly Chalkbot, although I still have much to learn
Okay, I realize it's been a while since I posted the original question, but I now have a follow up question.
If you have multiple viewports, and you use Lee Mac's LM:GetOverrideData routine, it returns data for each viewport in the drawing, as you might expect.
The curious thing is that if you have a color override in only one viewport, it returns that color for all viewports if there is no separate override on them.
For example, if I have 3 viewports, and I set a vplayer color in one of them to red, and the other 2 to green, lee's routine returns data which can be translated to indicate each viewport, and the corresponding override color.
However, If I set a vplayer color in viewport 1 to red, and I leave the other 2 with no overrides, lee's routine returns data that shows all 3 viewports as being overriden to red. (if I am not mistaken)
I'm working on a routine that needs to know the override status of a layer in every viewport, so I was hoping there was a way to determine if the override color returned by LM:GetOverrideData is active in each viewport. Thanks!