Jump to content
Developer Wiki and Function Reference Links ×

Problem with 'DoMenuTextByName' Command


Ridge

Recommended Posts

My question is regarding the Command ?DoMenuTextByName?.

I am trying to use said command to enter a predefined group, do what I need it to do, and then exit group. But every time I run the script it returns this error:

Error: OBJEDTCYCL DOMENUTEXTBYNAME - Menu cannot be found. Edit Group

Here is a simplified version of the script that I?ve been using as a test on the command:

Procedure ObjEdtCycl;

BEGIN

DoMenuTextByName('Edit Group', 0);

SelectObj((((C='Beam-Mask')|(C='Joist-Mask'))));

DoMenuTextByName('Exit Group', 0);

END;

RUN(ObjEdtCycl);

Symbols cannot replace the predefined groups because that option would produce too many unique symbols for every drawing sheet.

And when I simply ungroup the entities in my script, I get a dialogue box about ungrouping objects with record or class information. Since I want to avoid user interaction with the script, this option is also not available.

For those of you who want to know: I am working in VectorWorks 11.5 on a Mac running OS X. It also doesn?t help that this is the first script I have ever written, so I?m sure I?m doing something very simple in a very wrong way.

I?d appreciate it if anyone could shed some light on this problem. Or if there is no way to edit groups via script command, is there any way to suppress the warning dialogue one would receive when ungrouping something with record or class information?

Link to comment

Edit Group, Exit Group, and Top Level are part of a " Menu Chunk". To use them with DoMenuTextByName, use the name of the menu chunk and the item position of 1, 2 or 3.

For Edit Group, it woud be:

DoMenuTextByName('Group Navigation Chunk', 1);

For Exit Group use the index of 2.

The names of the menu chunks can be found in the VectorScript Appendix, the index number corresponds to the order of the commands in the menu.

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