CharlieDFW Posted 22 hours ago Posted 22 hours ago Cursorsize changes the size, cursortype will change to Windows style pointer. But there isn’t a cursorcolor. Is there a way to use lisp to change the cursor color? Quote
dexus Posted 21 hours ago Posted 21 hours ago (edited) Its set in OLE_COLOR, so some color conversion might be necessary. Or you can hardcode the color by changing it in the settings and retrieving the color-code using the first code below. Here is how to get the current color: (if (setq dis (vla-get-display (vla-get-Preferences (vlax-get-acad-object)))) (vlax-variant-value (vlax-variant-change-type (vla-get-ModelCrosshairColor dis) vlax-vbLong)) ; Current color ) And this way you can change the cursor color: (if (setq dis (vla-get-display (vla-get-Preferences (vlax-get-acad-object)))) (vla-put-ModelCrosshairColor dis 255) ; Change to red ) Edited 21 hours ago by dexus Quote
Lee Mac Posted 19 hours ago Posted 19 hours ago Some food for thought - https://www.theswamp.org/index.php?topic=56816.msg605115#msg605115 To obtain the colour numbers, you can use my RGB<->OLE conversion functions: https://lee-mac.com/colourconversion.html#rgbole Quote
BIGAL Posted 14 hours ago Posted 14 hours ago (edited) Options, Display, there is an item cross hair color, in Bricscad. Its X Axis color Y axis color. I run Black background so colors like red are good. No code required. Edited 14 hours ago by BIGAL Quote
lido Posted 1 hour ago Posted 1 hour ago Try this. ;;Changing the color of CrossHair (transparent command) (DEFUN C:CHCOL (/ c d l m n o p) (setq c (quote ("Black" "Red" "Yelow" "Green" "Cyan" "Blue" "Magenta" "White" "8" "9")) l (quote ( 0 255 65535 65280 16776960 16711680 16711935 16777215 8421504 12632256)) d (vla-get-display (vla-get-preferences (vlax-get-acad-object))) m l o (vlax-variant-value (vlax-variant-change-type (if (= (getvar "TILEMODE") 0) (vla-get-layoutcrosshaircolor d) (vla-get-modelcrosshaircolor d) ) vlax-vbLong ) ) n (member o l) ) (cond ;;Rearrange list l with the First item = Current color from the list l ( (and n (/= o 0)) (setq l (append n (vl-remove-if (function (lambda (x) (member x n))) l))) ;;(v1 v2 n v3 v4 v5 ...) -> (n v3 v4 v5 ... v1 v2) ) ;;Add current color to lists ( (not n) (setq l (cons o l) m l c (cons (strcat (itoa (lsh (lsh o 24) -24)) "," (itoa (lsh (lsh o 16) -24)) "," (itoa (lsh o -16))) c) ) ) (T nil) ) (princ (strcat "\nCurrent color: " (nth (vl-position (car l) m) c) ". [Right Mouse Button/Enter Key/Space Key] to accept or any key to cycle CrossHair colors." ) ) (while (and (not (vl-catch-all-error-p (setq p (vl-catch-all-apply (function grread))))) ;;<Esc> (not (equal p (quote (2 13)))) ;;<Enter> (not (equal p (quote (2 32)))) ;;<Space> (/= (car p) 25) ;;Right mouse button ) (setq l (append (cdr l) (list (car l)))) (if (= (getvar "TILEMODE") 0) (vla-put-layoutcrosshaircolor d (car l)) (vla-put-modelcrosshaircolor d (car l)) ) (princ (strcat "\nCrossHair Color: " (nth (vl-position (car l) m) c))) ) (princ) ) ;;CHCOL Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.