Jump to content
Developer Wiki and Function Reference Links ×

Toggle Show 2d not working properly in VW2015


billtheia

Recommended Posts

I've just started using VW2015 and have discovered a problem with a script I created to toggle showing of 2d info in 3d views. The script is changing the setting as intended but the screen is not refreshing to show the new condition. The update only appears after I change views.

Can someone help me figure out why this isn't working as it was in VW2014 & before?

Thanks.

Here's the script:

PROCEDURE ToggleShow2D;

BEGIN

SetPref(95, not GetPref(95));

SetPref(102, TRUE);

ReDrawAll;

END;

RUN(ToggleShow2D);

See screen shot for the setting in question.

Link to comment
The script is changing the setting as intended but the screen is not refreshing to show the new condition. The update only appears after I change views.

I don't have an answer to your script question, but I have also noticed in both Vw2015 & 2016 that the screen does not always refresh after changing something; It's like the change I made wasn't big enough to trigger a refresh.

There's a chance your script might be working correctly and Vectorworks is just not redrawing as it should. :(

Link to comment
  • 2 weeks later...
  • 1 month later...

OK. I'm starting to use VW2015 more now and Raymond's suggestion isn't doing what I need. It's actually just toggling stack layers on and off. I'm trying to toggle the display of 2d information in non-2d views, which is pref 95 not 94.

My script appears to be changing the setting but I can't get the screen to refresh without manually changing views.

Can anyone out there help me?

Thanks.

Link to comment

Bill,

   There is definitely a change between VW 2014 and VW 2015.

Pref 94 toggles Stacked Layers (Unified View)

Pref 95 toggles Display Screen Objects (when Unified View is ON)

   I tried your script in VW 2014 and saw how it toggles, and it does not toggle the same (or at all) in VW 2015. I'd say it's broken in 2015. I'll submit a bug and reference this thread.

   If I find a workaround, I'll post back here, but I didn't see anything obvious offhand.

Raymond

Link to comment

Thanks, Raymond.

The odd thing is that the script actually does toggle the show 2d option (if you use the script and then go into unified view options you'll see that it has checked or unchecked the appropriate box) it just isn't refreshing the screen to show the new condition.

Thanks for filing the bug. Unfortunately, I think that NVW has already issued the last service pack for VW2015 so I don't think this will get fixed.

Link to comment

Had just started a separate thread about what turns out to be the same issue – the following script now works for me. It re-sets the Layer Options to the current setting, and thus forces a redraw that for whatever reason does the trick when REDRAW and REDRAWALL do not:

PROCEDURE Toggle_DisplayScreenObj;

BEGIN

SetPref(95,NOT GetPref(95));

SetPref(506, GetPref(506));

END;

RUN (Toggle_DisplayScreenObj);

Cheers,

Markus

p.s. As some of you may have noticed, in 2016 any scripts you add to your Document Context menu cannot be run via keyboard shortcut – weird! Adding them to another menu instead solves the problem...

Link to comment

Had just started a separate thread about what turns out to be the same issue – the following script now works for me. It re-sets the Layer Options to the current setting, and thus forces a redraw that for whatever reason does the trick when REDRAW and REDRAWALL do not:

PROCEDURE Toggle_DisplayScreenObj;

BEGIN

SetPref(95,NOT GetPref(95));

SetPref(506, GetPref(506));

END;

RUN (Toggle_DisplayScreenObj);

Cheers,

Markus

p.s. As some of you may have noticed, in 2016 any scripts you add to your Document Context menu cannot be run via keyboard shortcut – weird! Adding them to another menu instead solves the problem...

Link to comment

Thank you Markus!.

I had a script for toggling certain class visibilities a while back. The toggling worked in 2D using the ShowClass/HideClass/GrayClass calls, but could never work in 3D openGL view.

Adding the LayerOption reset call you mentioned fixed this.

Much appreciated.

Tui

Link to comment

{ Toggle "Display Screen Objects" when Unified View (Stack-Layers) is ON. }
SetPref(95, not GetPref(95));		{ Stack-Layers option to create 2D objects }
SetPrefInt(506, GetPrefInt(506));	{ set Layer Options to same value. Needed for screen redraw. }

Here's a shortened version of the same script. Nice find, Marcus.

Raymond

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...