70002597 Visual imprevement of some cmd commands and actions

Article 70002597
Type Wish
Product Engine
Version 1102
Date Added 11/26/2024 12:00:00 AM
Fixed 11.3.3.0 (12/3/2024 12:00:00 AM)
Submitted by Peter Chanios

Summary

Visual imprevement of some cmd commands and actions (Fillet, Extend, Trim, Offset, ExTrim and Break).

Solution

We made a small change in the visualization of the following commands : Fillet, Extend, Trim, Offset, ExTrim and Break.
The change was applied at the last step of these commands where the user is asked for the last point in order to finalize the process.
When the user moves the mouse over entities the cursor will show the result of the command if the user clicks or a sign that the command is not possible (see images below).

Note the flag Document.GlobalRenderProperties.SelectionPreview = vdRenderGlobalProperties.SelectionPreviewFlags.ON needs to be ON in order for these visualizations to be active. Check at the bottom of this article if you want to have the SelectionPreview OFF and also see these visualizations.

Preview the result of Trim Command with a green highlighed line.

A red sign if the Trim command is not possible.



First select the entities for the extend command.

Preview the extend result with a highlighted line at the same color of the Extended figure.

A red sign if the Extend command is not possible.



First select the entities for the extend command.

Preview the Fillet result with a highlighted line at the same color of the fillet figure.

A red sign if the Fillet command is not possible.


Break a circle.

Preview the result of the break command.


Preview inside offset result.

Preview outside offset result.


Preview inside of ExTrim command.

Preview outside of ExTrim command.




If you do not want to have SelectionPreview On just to have this feature then you can enable it only for this command with a code like below using the ActionStart and ActionFinish events.
 private void Doc_ActionFinish([System.Runtime.InteropServices.MarshalAs(System.Runtime.InteropServices.UnmanagedType.IDispatch)] object sender, [System.Runtime.InteropServices.MarshalAs(System.Runtime.InteropServices.UnmanagedType.IDispatch)] object action)
        {
            if (action.ToString ().Contains("ActionTrim")) doc.GlobalRenderProperties.SelectionPreview = vdRenderGlobalProperties.SelectionPreviewFlags.OFF;
            else if (action.ToString().Contains("ActionExtend")) doc.GlobalRenderProperties.SelectionPreview = vdRenderGlobalProperties.SelectionPreviewFlags.OFF;
            else if (action.ToString().Contains("ActionFillet")) doc.GlobalRenderProperties.SelectionPreview = vdRenderGlobalProperties.SelectionPreviewFlags.OFF;
            else if (action.ToString().Contains("ActionBreak")) doc.GlobalRenderProperties.SelectionPreview = vdRenderGlobalProperties.SelectionPreviewFlags.OFF;
            else if (action.ToString().Contains("ActionOffset")) doc.GlobalRenderProperties.SelectionPreview = vdRenderGlobalProperties.SelectionPreviewFlags.OFF;
            else if (action.ToString().Contains("ActionExTrim")) doc.GlobalRenderProperties.SelectionPreview = vdRenderGlobalProperties.SelectionPreviewFlags.OFF;
        }

        private void Doc_ActionStart([System.Runtime.InteropServices.MarshalAs(System.Runtime.InteropServices.UnmanagedType.IDispatch)] object sender, string actionName, ref bool cancel)
        {
            if (actionName.Equals("BaseAction_ActionTrim")) doc.GlobalRenderProperties.SelectionPreview = vdRenderGlobalProperties.SelectionPreviewFlags.ON;
            else if (actionName.Equals("BaseAction_ActionExtend")) doc.GlobalRenderProperties.SelectionPreview = vdRenderGlobalProperties.SelectionPreviewFlags.ON;
            else if (actionName.Equals("BaseAction_ActionFillet")) doc.GlobalRenderProperties.SelectionPreview = vdRenderGlobalProperties.SelectionPreviewFlags.ON;
            else if (actionName.Equals("BaseAction_ActionBreak")) doc.GlobalRenderProperties.SelectionPreview = vdRenderGlobalProperties.SelectionPreviewFlags.ON;
            else if (actionName.Equals("BaseAction_ActionOffset")) doc.GlobalRenderProperties.SelectionPreview = vdRenderGlobalProperties.SelectionPreviewFlags.ON;
            else if (actionName.Equals("BaseAction_ActionExTrim")) doc.GlobalRenderProperties.SelectionPreview = vdRenderGlobalProperties.SelectionPreviewFlags.ON;
        }

Send comments on this topic.