PDA

View Full Version : Eyedropper tool



Wish List System
2015-07-25, 10:00 AM
Summary: Add to the color selector the possibility to pick a color from other object or image like the photoshop eyedropper tool

Description: From the color properties dialogue or tab have an eyedropper tool icon like in photoshop that can pick the color of other object or from an image

Product and Feature: AutoCAD - Object Properties Manager

Submitted By: John Ros‚ on 07/25/2015

wrmarshall
2015-08-18, 02:08 PM
does match properties not resolve this?

BlackBox
2015-08-18, 03:25 PM
Summary: Add to the color selector the possibility to pick a color from other object or image like the photoshop eyedropper tool

Description: From the color properties dialogue or tab have an eyedropper tool icon like in photoshop that can pick the color of other object or from an image

Product and Feature: AutoCAD - Object Properties Manager

Submitted By: John Ros‚ on 07/25/2015

I'd have to port this code to .NET API to display an actual 'eye dropper' cursor / badge, but here's a quickly written LISP routine to effectively change CECOLOR system variable to whatever color the selected entity is (i.e., ByLayer, ByBlock, Index, or True Color), and supports UNDO:



(vl-load-com)

(defun c:SetColor (/ *error* ss acDoc oTrueColor)

(defun *error* (msg)
(if acDoc
(vla-endundomark acDoc)
)
(cond ((not msg)) ; Normal exit
((member msg '("Function cancelled" "quit / exit abort"))) ; <esc> or (quit)
((princ (strcat "\n** Error: " msg " ** "))) ; Fatal error, display it
)
(princ)
)

(if (setq ss (ssget ":S:E"))
(progn
(vla-startundomark
(setq acDoc (vla-get-activedocument (vlax-get-acad-object)))
)
(setvar
'cecolor
(if
(= acColorMethodByRGB
(vla-get-colormethod
(setq oTrueColor
(vla-get-truecolor
(vlax-ename->vla-object (ssname ss 0))
)
)
)
)
(strcat
"RGB:"
(itoa (vla-get-red oTrueColor))
","
(itoa (vla-get-green oTrueColor))
","
(itoa (vla-get-blue oTrueColor))
)
(itoa (vla-get-colorindex oTrueColor))
)
)
)
)

(*error* nil)
)


** Note - Code does not account for all possible ColorMethods.



Cheers