Viewport Control Text Color

Viewport Control Text Color

istvan_voiculescu
Enthusiast Enthusiast
1,164 Views
3 Replies
Message 1 of 4

Viewport Control Text Color

istvan_voiculescu
Enthusiast
Enthusiast

I can find lots of Active X properties like (vla-put-GraphicsWinModelBackgrndColor disp 0). Is there any property that defines the text color of the viewport control? If I change the background color to white, and if the viewport control is also white, then I need to change the VP control text color to something else to be visible. I guess it could be done with registry edits, since the value is stored in the registry for HKCU. What I am planning is to have a LISP routine that changes the display settings based on the user. So if I go to a specific users machine to help them, I can change the settings to my custom ones and then he can revert them to his settings. Those settings will be defined for each user by lisp.

 

Here I have the code that I compiled together using some of Lee Mac's code and some other code I found around.

 

(defun c:chd ( / disp drafting)
(setvar "cmdecho" 1)
(princ "\nLoading Menu...")
(initget 1 "BLACK WHITE GREY")
(setq MYCOLOR (getkword "\nChoose [BLACK/WHITE/GREY]: "))
(cond
( (= MYCOLOR "BLACK")
(vl-load-com)
(setq disp (vla-get-display (vla-get-preferences (vlax-get-acad-object))))
(setq drafting (vla-get-drafting (vla-get-preferences (vlax-get-acad-object))))
(vla-put-GraphicsWinModelBackgrndColor disp 0)
(vla-put-GraphicsWinLayoutBackgrndColor disp 0)
(vla-put-LayoutCrosshairColor disp 16777215)
(vla-put-ModelCrosshairColor disp 16777215)
(vla-put-AutoTrackingVecColor disp 16777215)
(vla-put-AutoSnapMarkerColor drafting 2)
)
( (= MYCOLOR "WHITE")
(vl-load-com)
(setq disp (vla-get-display (vla-get-preferences (vlax-get-acad-object))))
(setq drafting (vla-get-drafting (vla-get-preferences (vlax-get-acad-object))))
(vla-put-GraphicsWinModelBackgrndColor disp 16777215)
(vla-put-GraphicsWinLayoutBackgrndColor disp 16777215)
(vla-put-LayoutCrosshairColor disp 0)
(vla-put-ModelCrosshairColor disp 0)
(vla-put-AutoTrackingVecColor disp 0)
(vla-put-AutoSnapMarkerColor drafting 2)
)
( (= MYCOLOR "GREY")
(vl-load-com)
(setq disp (vla-get-display (vla-get-preferences (vlax-get-acad-object))))
(setq drafting (vla-get-drafting (vla-get-preferences (vlax-get-acad-object))))
(vla-put-GraphicsWinModelBackgrndColor disp 4605510)
(vla-put-GraphicsWinLayoutBackgrndColor disp 4605510)
(vla-put-LayoutCrosshairColor disp 16777215)
(vla-put-ModelCrosshairColor disp 16777215)
(vla-put-AutoTrackingVecColor disp 16777215)
(vla-put-AutoSnapMarkerColor drafting 2)
)
)
(princ)
)

 

ISTVAN “ISHKA” VOICULESCU
CAD/IT Systems Admin Sr.
BIM / CADD MANAGER
CITY OF AUSTIN, PUBLIC WORKS DEPARTMENT
ENGINEERING SERVICES DIVISION
0 Likes
1,165 Views
3 Replies
Replies (3)
Message 2 of 4

phanaem
Collaborator
Collaborator

Hi

 

Each vla-put-...color function in your lisp expect a variant  as an argument (except AutoSnapMarkerColor, which I confess, I don't know what it does. Nothing visible is changed in my drawing)

 

You can use something like this:

(vla-put-GraphicsWinModelBackgrndColor  disp (vlax-make-variant 16777215 vlax-vblong))

 

0 Likes
Message 3 of 4

istvan_voiculescu
Enthusiast
Enthusiast

I am looking if there is an ActiveX property that defines the Viewport Control Text color. The code I supplied works fine. I just don't know if there is an activeX for the Viewport Control Text Color, or that is available only via registry.

ISTVAN “ISHKA” VOICULESCU
CAD/IT Systems Admin Sr.
BIM / CADD MANAGER
CITY OF AUSTIN, PUBLIC WORKS DEPARTMENT
ENGINEERING SERVICES DIVISION
0 Likes
Message 4 of 4

phanaem
Collaborator
Collaborator

Sorry for the mess..

I didn't find any ActiveX property, only an environment variable.

(setenv "2D Model viewport control color" "0") for black
(setenv "2D Model viewport control color" "16777215") for white

0 Likes