Macro force notes in red

Hello

With a macro I insert an existing annotation in a library.

I would like this annotation to be red, to do this I think I need to put the line color palette in red.

 

 

Know the command calling this function?

 

Thank you in advance for your feedback

 


mep_-_insert_indice_de_revision.swp

Hello

A silly question, but why not put your note directly in red and re-record it.

1 Like

That's what I thought, but it doesn't work, it's the palette that determines the color.

FYI, I thought of this command swDraw.SetLineColor, but it's not this one that controls the color of the palette.

Set swDraw = swModel
swDraw.SetLineColor RGB(255, 0, 0)

 

 

 

Hello

You have the option to create a red layer, and place your annotation in this new layer.

1 Like

Hello

For my part, I create layers for each piece of information I want on my plan

It's much simpler

1 Like

 

Via the macro I place the annotation in a red layer.

However, by macro it is the color selected in the choice palette that drives the color

Good evening

You have to select the red color and check "Default". Just put the notes in this layer at the end.

Edit: Having previously activated the layer.

2 Likes

Hello

Check out this post and read it to the end, you should find some things that can help you, including a function that allows you to create a red layer if it doesn't exist and add an annotation to it.

Kind regards

1 Like

Here is the rest of the subject:

https://www.lynkoa.com/forum/mise-en-plan/couleur-de-note-qui-ne-correspond-pas-%C3%A0-la-couleur-de-calque

To complete D.Roger's answer and I also  confirm for the colors to be applied, it is imperative that the default box is checked.

And so insert the note into a layer of the right color.

1 Like

Hello everyone and thank you for your answers.

Is it possible to enable or disable this "Default" checkmark via a macro?

 

Thank you

Can the "Default" box be checked by default?

Solidworks option? Macro?

Yannick

Hello

Normally default is checked when you put a color on a layer. He is the one who is driving, you have to uncheck to be able to put another color in the same layer.

1 Like

The problem is that I don't have an automatic checkmark by default.

I can't find where this is set in the Solidworks options.

I'm in Solidworks 2017

This is set in the file template, but normally the default is checked when creating a layer (visible only by placing a note or a line and selecting the "line color" tool), the color of the lines/notes is set by default by the color of the layer.

If someone has unchecked for a particular note, it doesn't disable for the rest of the layer.

If nothing is selected, this tool displays a default setting of SW that I know of, but which is not related to the layer setting.

Edit: Regardless of the version of SW it seems to me that it has been working this way since at least 2003/2004. I'm on SW2019

I found the answer to my question, it's the palette that drives the colors and not an option in solidworks.

For the palette to be on default, you need nothing selected -> click on "default" -> Click on OK.

 

 

 

1 Like

Hello

Yes and this is the solution given as the best answer in this link that  sbadenis gave you previously.

Kind regards

Hello

Thank you all for your feedback. I found the solution yesterday on the lynkoa site and share by d.roger and sbadenis.          

Thank you all.