Skip to main content
1-Visitor
November 15, 2016
Question

how to add model display transparency on/off toggle mapkey

  • November 15, 2016
  • 3 replies
  • 5080 views

Model Display>Component Display Style>Transparent & shaded useing only one key.

required mapkey for toggle transparency on/off

    3 replies

    1-Visitor
    November 15, 2016

    It is not possible to do it by mapkey I think. You can only set the display style by macro, but to implement the toggle on/off functionality you have to test if the component is transparent or not. If it is transparent, you have to remember the current state and set the transparency. If it is already transparent, you have to restore previous (remembered) style. The problem is you cannot read the style by macro...

    12-Amethyst
    November 15, 2016

    I think it's no possible too...

    The best you can achieve is a combination of mapkeys like this:

    mapkey $F2 %CP_SHADE;

    mapkey CP_SHADE ~ Command `ProCmdViewShaded`; %&L1; %TRANSP; %&L2;

    mapkey CP_TRANSP ~ Command `ProCmdViewTranspShaded`; %&L1; %SHADE; %&L2;

    mapkey TRANSP ~ Update `add_opt` `EditPanel` `$F2 %CP_TRANSP`;

    mapkey SHADE ~ Update `add_opt` `EditPanel` `$F2 %CP_SHADE`;

    mapkey &L1 ~ Command `ProCmdRibbonOptionsDlg` ;\

    mapkey(continued) ~ Select `ribbon_options_dialog` `PageSwitcherPageList` 1 `ConfigLayout`;\

    mapkey(continued) ~ Activate `ribbon_options_dialog` `ConfigLayout.AddOpt`;\

    mapkey(continued) ~ Input `add_opt` `InputOpt` `mapkey`; ~ Update `add_opt` `InputOpt` `mapkey`;\

    mapkey(continued) ~ Activate `add_opt` `InputOpt`;~ FocusOut `add_opt` `InputOpt`;

    mapkey &L2 ~ Activate `add_opt` `EditPanel`;\

    mapkey(continued) ~ Activate `ribbon_options_dialog` `OkPshBtn`;

    But I don't  know how to get the current state of the component.

    Jose

    1-Visitor
    November 16, 2016

    It should possible to solve it by Pro/Tookit by calling ProMdlVisibleAppearancepropsGet or wfcWSelecton::GetVisibleAppereance in OTK. So it requires to develop small auxiliary application

    dg-21-VisitorAuthor
    1-Visitor
    November 16, 2016

    Jose Costa‌ mapkey is not working. i need this as for in assembly part make individual selected part to be as transparent.

    no im using two mapkeys for that as simply i need it for one key use.

    mapkey tr ~ Command `ProCmdViewTranspShaded`;

    mapkey ty ~ Command `ProCmdViewShaded`;

    1-Visitor
    November 16, 2016

    As I have written, it should be solved by a small Pro/Toolkit application...

    23-Emerald IV
    November 16, 2016

    Here are the mapkeys we use to do this.  Make sure the component(s) are selected before you attempt to change the style.

    mapkey nsw @MAPKEY_NAMENew Style Wireframe;@MAPKEY_LABELNew Style Wireframe;\
    mapkey(continued) ~ Command `ProCmdViewWireframe`;

    mapkey nst @MAPKEY_NAMENew Style Transparent;@MAPKEY_LABELNew Style Transparent;\
    mapkey(continued) ~ Command `ProCmdViewTranspShaded`;

    mapkey ms @MAPKEY_NAMEMaster Style;@MAPKEY_LABELMaster Style;\
    mapkey(continued) ~ Command `ProCmdViewVisTool` ;\
    mapkey(continued) ~ Select `visual_dlg0` `RadioSelApplMgr` 1 `display style`;\
    mapkey(continued) ~ Activate `visual_dlg0` `Table` 2 `master style` `name_column`;\
    mapkey(continued) ~ Activate `visual_dlg0` `CloseBtn`;

    23-Emerald IV
    November 16, 2016

    We also have something similar for on-the-fly simplified reps.  Just select the components and type "nr".  Very handy!

    mapkey mr @MAPKEY_NAMEActivate Master Rep;@MAPKEY_LABELMaster Rep;\
    mapkey(continued) ~ Command `ProCmdViewVisTool` ;\
    mapkey(continued) ~ Select `visual_dlg0` `RadioSelApplMgr`1  `simplified rep`;\
    mapkey(continued) ~ Activate `visual_dlg0` `Table`2  `master rep` `name_column`;\
    mapkey(continued) ~ Activate `visual_dlg0` `CloseBtn`;

    mapkey nr @MAPKEY_NAMECreate New Rep;@MAPKEY_LABELNew Rep;\
    mapkey(continued) ~ Command `ProCmdViewNormalMaster`;\
    mapkey(continued) ~ Command `ProCmdViewInclude`;