Click select line object problem

Rhino6 show the end points automatically after clicking line.

I want add end points and display in red and green.


The end points created by clicking line will cover the red and green end points which I added.
We can not show the red and green end points in view.

How do I fix the problem?

Hi -

I probably don’t understand the problem completely but does it help to turn off the Turn on control points when selecting a curve, light or annotation in Rhino Options > Mouse?
-wim

Hi Wim,

It works, thank you.
What function can disable this option?

Kindly regards,
Vaker

Hi Vaker -

I take that this means that you want to be able to set that with code.
You should be able to run the following macro from within your program:

-Options Mouse SelectionAndMiddleButton AutomaticPointsOn=No EnterEnd

-wim

Hi Wim,

I want to check the “AutomaticPointsOn” option “Yes” or “No” before run the macro.
How to do with code?

or change “AutomaticPointsOn” = “No” by another way (not runscript)?
I do want to run the macro every time.

Kindly regards,
Vaker

Hi Vaker - I don’t know if there is anything in RhinoCommon for checking or setting this option.
@dale, could you provide more information here?
-wim

Hi @Vaker,

How about this?

CRhinoCommand::result CCommandTestVaker::RunCommand(const CRhinoCommandContext& context)
{
  bool bAutomaticPointsOn = RhinoApp().AppSettings().GeneralSettings().m_bAutomaticPointsOn;
  if (bAutomaticPointsOn)
  {
    CRhinoAppGeneralSettings settings = RhinoApp().AppSettings().GeneralSettings();
    settings.m_bAutomaticPointsOn = false;
    RhinoApp().AppSettings().SetGeneralSettings(settings);
  }

  // TODO...

  if (bAutomaticPointsOn)
  {
    CRhinoAppGeneralSettings settings = RhinoApp().AppSettings().GeneralSettings();
    settings.m_bAutomaticPointsOn = bAutomaticPointsOn;
    RhinoApp().AppSettings().SetGeneralSettings(settings);
  }

  return CRhinoCommand::success;
}

– Dale

Thanks for @dale, @wim help.
I can fix my problem now.

Kindly regards,
Vaker