Author Topic: Command colors  (Read 411 times)

Dr PR

  • Hero Member
  • *****
  • Posts: 5436
Command colors
« on: November 18, 2016, 02:22:25 PM »
OK. Here's a request that might sound odd. What if we could assign a color to the outcome of a command?

I use "Draw/Line/Surface Intersection" very frequently (I have assigned it to CTRL+Z) to find the intersections of planes, grids and solids.

The resulting lines are not actually a part of the drawing I am creating, but just reference lines to show the intersections - or lack of an intersection. Before I use the function I change the current drawing color to some color not already used in the drawing. In fact, I reserve the bright magenta color (RGB 255, 43, 255) just for this purpose because it is easy to see. After everything is drawn I can use the Selection Filter to select any residual surface intersection lines so I can delete them from the drawing.

On some occasions I use two or three colors for intersections where a bunch of things come together - always using a color that isn't already in the drawing so it is easy to see the intersection lines.

If I could just assign a color to the Surface Intersect function before the line was created it would save the work of switching between different drawing colors before and after the intersection -and possibly changing back to the wrong color after the intersect operation. And it would help ensure that all intersection lines were the same color - making it easier to purge then from the drawing using the Selection Filter.

****

Right now I can't think of any other function where I would want to assign a color to the result of the operation. Anyone else have any thoughts about this?

Phil

DesignCAD user since 1987

Rob S

  • Hero Member
  • *****
  • Posts: 4329
    • Construction Estimating Program for General Contractors
Re: Command colors
« Reply #1 on: November 18, 2016, 02:51:10 PM »
I think this would be easily doable by a macro, then substitute that for your command. 

Seems this is the kind of thing so few people would have need for it would be better left that way??

Once such a macro was created, it would be easy to modify it to draw any particular entity or command result in a defined or selectable color.

note to self - get back up to speed on macros asap....
User since Pro-design

Bob P

  • Hero Member
  • *****
  • Posts: 1157
    • Era Replica Automobiles
Re: Command colors
« Reply #2 on: November 18, 2016, 03:49:13 PM »
Here's the macro...
Code: [Select]
'Surface Intersect with color
'sic.d3m
'Note that it records the original color, then changes to PR's preferred, then returns the original color on exit.
redval=sys(300)
greenval=sys(301)
blueval=sys(302)
sys(300)=255
sys(301)=43
sys(302)=255
>surfaceintersection
{
  }
sys(300)=redval
sys(301)=greenval
sys(302)=blueval
exit:

Lar

  • Hero Member
  • *****
  • Posts: 2542
Re: Command colors
« Reply #3 on: November 18, 2016, 06:00:07 PM »
OK. Here's a request that might sound odd. What if we could assign a color to the outcome of a command?
It's not that odd... dimensions and text have that feature already. Only difference the option should be in the command's dialog instead of the Options dialog.

Linetype and layer should also be included. I do the same thing as Phil except I make the temp lines 2.00 mm so they jump out all the time, even if they are selected with other stuff.

Lar
« Last Edit: November 18, 2016, 06:07:12 PM by Lar »

Rob S

  • Hero Member
  • *****
  • Posts: 4329
    • Construction Estimating Program for General Contractors
Re: Command colors
« Reply #4 on: November 18, 2016, 06:18:09 PM »
I always preferred designcd's system where all entities are drawn to the current layer color and linetype, as opposed to Turbocad where you had to assign a color and linetype to each command.   

This was hell if you wanted to start drawing on a different layer and color without setting the color by layer option, which we have available also.

Now it seems we are asking for an "optional" pre-assignable color override for every command.

In order to prevent this from overriding what I find to be a very desirable existing feature of designcad, it would then require a command to reset all commands to use current color...

Etc, Etc

User since Pro-design

Dr PR

  • Hero Member
  • *****
  • Posts: 5436
Re: Command colors
« Reply #5 on: November 18, 2016, 08:21:52 PM »
Rob,

I agree with what you are saying. Color and line type by layer are essential for some types of drafting - maps come to mind where each layer has a color and/or line style. I have always been a little miffed that DesignCAD allows you to disable these features on an object by object basis  - that sort of defeats the layer properties options. But it does keep with the program's character of allowing a profusion of options.

I am not suggesting that every command have a color option. I see no reason for that. That would be a waste of programmer time, in my opinion. But some might benefit from it. And when such command colors are used the objects should be created with the by layer options enabled so the layer color and line style take precedence.

I'll try Bob P's macro and see if it works. However, to be useful a macro would need to remember the assigned command color every time it is executed, even between drawing sessions. Don't know if there is a way to do that. Otherwise it will be as  much of a nuisance having to assign the color every time it executes as it is now.

Phil
DesignCAD user since 1987

JJG

  • Hero Member
  • *****
  • Posts: 717
Re: Command colors
« Reply #6 on: November 18, 2016, 11:35:54 PM »
Hello,
my only concern with Bob's macro is if you are working with color by layer enabled (i.e. "Layer uses specific color", sys(530)=1, and "Enforce layer color settings on all new entities", sys(541)=1 ), you have to store these statements of these sys-functions in the macro before doing anything, then disable them, then the action doing by the macro, then restore sys(530) and sys(515), the end the macro.
If not, the macro will not work as you are expecting ...



Bob P

  • Hero Member
  • *****
  • Posts: 1157
    • Era Replica Automobiles
Re: Command colors
« Reply #7 on: November 19, 2016, 04:02:21 AM »
...
I'll try Bob P's macro and see if it works. However, to be useful a macro would need to remember the assigned command color every time it is executed, even between drawing sessions. Don't know if there is a way to do that. Otherwise it will be as  much of a nuisance having to assign the color every time it executes as it is now.
Phil
The print and open commands can be used to save to and retrieve values from an external file.

Rob S

  • Hero Member
  • *****
  • Posts: 4329
    • Construction Estimating Program for General Contractors
Re: Command colors
« Reply #8 on: November 19, 2016, 10:22:37 AM »
In the sample, the assigned command color is hard-coded, so no need to write any file.

For the original purpose, this would be quite adequate.
User since Pro-design