Area Add Object vs Subtract Object Color

Area Add Object vs Subtract Object Color

paullimapa
Mentor Mentor
1,284 Views
19 Replies
Message 1 of 20

Area Add Object vs Subtract Object Color

paullimapa
Mentor
Mentor

I know you can change the selection area color using either CROSSINGAREACOLOR  or WINDOWAREACOLOR

But these have no impact when using Area Add or Subtract Objects.

I don't see similar system variables for AREAADDCOLOR or AREASUBTRACTCOLOR.

Any way to change these?


Paul Li
IT Specialist
@The Office
Apps & Publications | Video Demos
0 Likes
1,285 Views
19 Replies
Replies (19)
Message 2 of 20

john.uhden
Mentor
Mentor

Are you wanting to add objects' areas only of a certain color?

If so, then just include the color in your selection filter.

Or maybe you want to add the area of objects with certain colors and subtract objects with other colors.

When you say color do you mean objects with color overrides, or do you mean objects whose layers are certain colors, or both?

If you want to both add and subtract in the same AREA command, then you will have to process the selection set of all objects being considered and keep the command running object by object with "Add" or "Subtract" responses within.

OR, you could process the selection set to subdivide into a second selection set thereby having a set of adds and a set of subtracts.  But I'm forgetting how the command works and my AutoCAD isn't running.

I personally wouldn't use the AREA command, but process the selection set by acquiring each 'Area property and adding to a Plus value or a Minus value depending on color.  It can get slightly more complicated if you want to enter multiple colors in your (getstring) function, but we have an answer for that if you don't have a method already.  Then again you could ask for colors separately via (while (setq color (getint ...)...) ...) and create a list of them, which you would need anyway.

John F. Uhden

0 Likes
Message 3 of 20

paullimapa
Mentor
Mentor

No, I'm not referring to object or layer color. I'm referring to the Area command during the add selection vs subtract selection process.  During Add process as you pick points on the screen a "green" screen color would appear to designate the polygon you are drawing to represent the area you want to add.  Likewise during the Subtract process as you pick points on the screen a "red" screen color would appear to designate the polygon you are drawing to represent the area you want to subtract.  My question is that there seems to be no system variable to change these two color schemes that appear on the screen while executing the Area command to Add and Subtract.


Paul Li
IT Specialist
@The Office
Apps & Publications | Video Demos
0 Likes
Message 4 of 20

john.uhden
Mentor
Mentor
As I rarely use the AREA command, I have never noticed the red and green
you mention, but I don't see why you would need to change them.
Do you also have objection to the colors of traffic lights?

John F. Uhden

0 Likes
Message 5 of 20

paullimapa
Mentor
Mentor

I just thought that since AutoCAD provides so many system variables including the option to change the Selection area color by using either CROSSINGAREACOLOR  or WINDOWAREACOLOR, it would make perfect sense for similar system variables like AREAADDCOLOR or AREASUBTRACTCOLOR.


Paul Li
IT Specialist
@The Office
Apps & Publications | Video Demos
0 Likes
Message 6 of 20

john.uhden
Mentor
Mentor
So I was right... You don't like red lights. I agree. They slow down my
trip to work.

John F. Uhden

0 Likes
Message 7 of 20

paullimapa
Mentor
Mentor

yes, let's turn off all the lights completely and bring AutoCAD back to the way it was in the dark ages...haha...


Paul Li
IT Specialist
@The Office
Apps & Publications | Video Demos
0 Likes
Message 8 of 20

john.uhden
Mentor
Mentor
Maybe the solution is to just turn off your monitor, though I don't know
how you do that on a laptop. 😕

John F. Uhden

0 Likes
Message 9 of 20

paullimapa
Mentor
Mentor

Or do like you do...just seldom use the Area command then I won't be bothered by the colors.


Paul Li
IT Specialist
@The Office
Apps & Publications | Video Demos
0 Likes
Message 10 of 20

Sea-Haven
Mentor
Mentor

Ok Logfileon

then setvar ? * 

Enter enter .......

logfileoff

The log file shows all the setvars "color" occurs 79 times, so good luck to maybe find.

 

You need to look at where your temporary files are written to find the dwg....log file, I have mine reset to a known directory.

0 Likes
Message 11 of 20

paullimapa
Mentor
Mentor

yep, already reviewed all the system variables which was how I ran into CROSSINGAREACOLOR  & WINDOWAREACOLOR.

I've submitted this as an idea item but will most likely end up in the black hole.


Paul Li
IT Specialist
@The Office
Apps & Publications | Video Demos
0 Likes
Message 12 of 20

hak_vz
Advisor
Advisor

@paullimapa  . Color for inverse action (add subtract) is defined in system as inverse color. If left selection color is defined as indexed color 100 that is equivalent to RGB (0  255 63).  Inverse color is defined as white - old color so in this case

 

(mapcar '-  '(255 255 255) '(0 255 63)) -> '(255 0 192)

 

There is some level of transparency added to these color i.e. they are represented as RGBA colors.

CROSSINGAREACOLOR affects selections (test with command SELECT). I don't know which system variable affects command ARRAY.

 

Untitled.png

 

 

Miljenko Hatlak

EESignature

Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.
0 Likes
Message 13 of 20

paullimapa
Mentor
Mentor

Yes I am aware of this. My original post may have confused you. I’m referring to the Area command and not selecting of objects.


Paul Li
IT Specialist
@The Office
Apps & Publications | Video Demos
0 Likes
Message 14 of 20

hak_vz
Advisor
Advisor

@paullimapa

I understood that you are looking into AREA command and selection colors in add and subtract mode. What I wanted to imply is that there is probably single system variable that for area add mode, while subtract mode selection color is inverse of area add mode selection color. Furthermore  if you have some area already selected selection color is different from inverse i.e it looks like there are two transparent solid fills whose color combine.

 

If you look into Area command add mode selection color is indexed color 100 whose inverse used in subtract mode  is defined as I described in sample, but I didn't manage to change selection colors for AREA command i.e. name of system variable is unknown to me.     

Miljenko Hatlak

EESignature

Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.
0 Likes
Message 15 of 20

paullimapa
Mentor
Mentor

Exactly...this is why I posted this as my initial question. But it's clear that AutoCAD has yet to expose the option to change the two colors (add vs subtract) within the Area command like it has with the Selection command (crossing vs window).  


Paul Li
IT Specialist
@The Office
Apps & Publications | Video Demos
Message 16 of 20

john.uhden
Mentor
Mentor

I couldn't resist.

Try out this totally untested function.

(defun area+- ( / add subtract what pick e obj +- result)
  (setq add "<Add,+>/Subtract,-"
        subtract "Add,+/<Subtract,->"
		what add
		+- + result 0.0
  )
  (initget 128)
  (while (setq pick (entsel (strcat "\nSelect object to " what ": ")))
    (cond
	  ((and (= (type pick) 'STR)(wcmatch (strcase pick) "A*,+"))
	    (setq what add +- +)
	  )
	  ((and (= (type pick) 'STR)(wcmatch (strcase pick) "S*,-"))
	    (setq what subtract +- -)
	  )
      ((and (listp pick)(setq e (car pick))(= (type e) 'ENAME))
	    (setq obj (vlax-ename->vla-object e))
		(if (vlax-property-availablep obj 'Area)
		  (princ (strcat "\n  Result so far = " (rtos (setq result (+- result (vlax-get obj 'Area))) 2 2)))
		  (princ "\n  Object selected has no area property.")
		)
	  )
	)
	(initget 128)
  )
  result
)

If it works, I should add gripping the selected objects so you can see what you've already selected and add them to a selection set so the function knows not to add an object more than once.

Please let me know.  I'll try it out myself at work on Monday.

John F. Uhden

0 Likes
Message 17 of 20

paullimapa
Mentor
Mentor

Thanks for trying.  Two errors: 

vlax-property-availablep function needs to be changed to funtion vlax-property-available-p
Any attempts to change during selection process to Subtract would error with:
Command: (area+-)
Select object to <Add,+>/Subtract,-: S
*Invalid selection*
Expects a point or Last
Select object to <Add,+>/Subtract,-:
But again if you read my original post, what I'm trying to change is the color fill tone while executing the AREA command.  When in "Add" mode AutoCAD will use a "Green" tone to fill the polygonal area as I select points or highlight the object I select to "Add" in "Green".  When in "Subtract" mode AutoCAD will use a "Red" tone to fill the polygonal area as I select points or highlight the object I select to Subtract in "Red".  AutoCAD has yet to provide an option for the user to change these two color tones to different tones or even turn them off all together like AutoCAD used to be.
Here's a youtube link to give everyone a refresher course of what it looks like when using AutoCAD's Area command:

Paul Li
IT Specialist
@The Office
Apps & Publications | Video Demos
0 Likes
Message 18 of 20

john.uhden
Mentor
Mentor
I am duly embarrassed. My assumptions were erroneous.
Please accept my apology.
BTW, the way I go about adding and subtracting areas is to hatch the areas
that I want and include the "holes" or exceptions when creating the hatch.
Then when you grip multiple hatches, the properties palette reports the
cumulative area. I put my hatches on separate layers so that...
1. I can differentiate one coverage from another.
2. I can freeze them if they are not meant to be plotted/published.
Also...
3. If you alter the hatch boundary you don't have to pick all those points
again.
4. If you have curves in your object's boundary, picking the area by
pointing will not provide an accurate result.

John F. Uhden

0 Likes
Message 19 of 20

paullimapa
Mentor
Mentor

Apology accepted. I also would use similar Hatch technique to get areas of multiple boundaries with holes. I even go a step further by using a Field to link the Hatch Area so that when things change I see the updated Area value automatically.


Paul Li
IT Specialist
@The Office
Apps & Publications | Video Demos
0 Likes
Message 20 of 20

john.uhden
Mentor
Mentor
Alrighty then. You're in good shape except for the color issue. Best of
luck with that.

John F. Uhden