Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 01/13/2019 in all areas

  1. To offer an alternative: (defun c:cc19 ( / d l ) (setq l '(8372223 255 65535 65280 16776960 16711680 16711935 16777215) d (vla-get-display (vla-get-preferences (vlax-get-acad-object))) ) (princ "\nPress TAB to cycle crosshair colors <done>: ") (while (equal '(2 9) (grread nil 10)) (vla-put-modelcrosshaircolor d (car (setq l (append (cdr l) (list (car l)))))) ) (princ) ) (vl-load-com) (princ) Glad you found the colour conversion functions useful @StevJ
    2 points
  2. Alternatively you could define separate scopes - For instance you have defined these functions: (defun C:test ( / ) (alert (strcat (alerting) ", guys")) (princ) ) (defun alerting nil "Hello" ) (defun C:test ( / ) (alert (strcat (alerting) ", there")) (princ) ) (defun alerting nil "Hi" ) You can wrap them in defuns with different names, but localise all the functions and subfunctions within: (defun C:test1 ( / C:test alerting ) (defun C:test ( / ) (alert (strcat (alerting) ", guys")) (princ) ) (defun alerting nil "Hello" ) (C:test) (princ) ) (defun C:test2 ( / C:test alerting ) (defun C:test ( / ) (alert (strcat (alerting) ", there")) (princ) ) (defun alerting nil "Hi" ) (C:test) (princ) ) Thats one of the reasons I keep my smaller subs localised, since they are generic and I might have been used similar in other .lsp file - like this one: (setq fill_listbox (lambda (k L) (start_list k) (mapcar 'add_list L) (end_list))) And other subfunctions of mine that are 200+ rows and almost no risk of me to overwrite them, as global - such as "MergePDFs" or "AddMyLayers".
    2 points
  3. Try (vlax-variant-value (vlax-variant-change-type (vla-get-modelcrosshaircolor (vla-get-display (vla-get-preferences (vlax-get-acad-object)))) vlax-vbLong)) Solution found Here I assume B, Jimmy is Jimmy Bergmark Explanation by Tony Tanzillo in post 5
    1 point
×
×
  • Create New...