Jump to content
  • 0

visibility toggle for individual classes


Dietmar Lorenz

Question

VA9 has 'show/hide guides' commands that can have individual keyboard shortcuts assigned to them. even better is the show-hide-redlines toggle. it would be helpful to have a toggle for show-hide-NonPlot, so objects parked in the generally invisible class can be retrieved more quickly. for other classes it could be helpfull, too.

unfortunately, the access to the show-or-hide-redline script is denied in the plug-in editor. i tried to duplicate and edit the script to make it apply the other classes, but it's locked. any ideas?

Link to comment

4 answers to this question

Recommended Posts

  • 0

The VectorScript that toggles visibility for a particular class can be very simple:

code:


if (GetCVis('foo') = 0) then

HideClass('foo')

else

ShowClass('foo');


This short script will toggle the visibility of a class called "foo". You can create a menu command and paste in the code above (changing "foo" to the name of whatever class you want to toggle, of course), and then add the menu command to your workspace.

It wouldn't be too much work to make that command more general -- for instance, it could present a dialog box which lets you select the class to toggle. But that sort of defeats the purpose of the script, which is to avoid having to use the classes dialog box to change visibility. So maybe this is a good example of the maxim "less is more."

Link to comment
  • 0

The VectorScript that toggles visibility for a particular class can be very simple:

code:


if (GetCVis('foo') = 0) then

HideClass('foo')

else

ShowClass('foo');


This short script will toggle the visibility of a class called "foo". You can create a menu command and paste in the code above (changing "foo" to the name of whatever class you want to toggle, of course), and then add the menu command to your workspace.

It wouldn't be too much work to make that command more general -- for instance, it could present a dialog box which lets you select the class to toggle. But that sort of defeats the purpose of the script, which is to avoid having to use the classes dialog box to change visibility. So maybe this is a good example of the maxim "less is more."

Link to comment
  • 0

thanks caleb, that worked like a charme!

did you read my other wishlist posting regarding group visibilities? i bet you'd know how to do it.

but here is another easy scripting question:

as wall style picking is still clumsy in va9, i used 'create custom tools' ,pasted the command script into a new tool and made that part of my workspace with shortcuts.

how can i adapt the script to use the layer-z and layer-delta-z instead of fixed wall-height and elevation?

this is what it looks like right now:

rocedure CustTool;

VAR

Name:STRING;

Result:BOOLEAN;

BEGIN

PushAttrs;

ClearCavities;

DoubLines(3 1/2");

PenSize(10);

PenPat(2);

SetZVals(0", 9'0");

FillFore(255);

FillBack(58);

FillPat(1);

PenFore(255);

PenBack(0);

PenPat(2);

PenSize(10);

PenPat(2);

Marker(0, 0.125000, 15);

NameClass('Style-2 wall int');

CallTool(-208);

PopAttrs;

thanks again,

dietmar lorenz

Originally posted by Caleb Strockbine:

The VectorScript that toggles visibility for a particular class can be very simple:

code:


if (GetCVis('foo') = 0) then

HideClass('foo')

else

ShowClass('foo');


...

Link to comment
  • 0

quote:

how can i adapt the script to use the layer-z and layer-delta-z instead of fixed wall-height and elevation?


I'm not sure I understand what you want the script to do. You say you want to use the layer z and delta-z values rather than fixed values, but the main place where I see values that might be z and delta-z is in your call to SetZVals(), which actually sets the z and delta-z for the active layer.

In any case, there's a GetZVals() routine that gets the z and delta-z for the active layer, and that may put you on the right track. Use the values you get from GetZVals() wherever you were previously using fixed values for z and delta-z if you want to use the current settings for the active layer. (But it doesn't make any sense to then call SetZVals() with those same values, since you'd just be setting z and delta-z to the same values they already have.)

Hope that helps.

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
Answer this question...

×   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...