vanowm Posted December 22, 2023 Posted December 22, 2023 (edited) There are some commands that show different menus depending on the previous input. How do we handle such situations? A simple example, when joining lines and arcs with PEDIT this command works: (command "_pedit" "_m" (ssget) "" "_y" "_j" 0 "") However, this same command fails when only polylines are selected (no lines and arcs) because it doesn't expect "_y" input: (command "_pedit" "_m" (ssget) "" "_j" 0 "") So, is there a way detect what does the command expects to be input at any given step? Thank you! P.S. Just to get this out of the way, as a work around in this particular case I could detect what objects are selected and go with appropriate command sequence. That's not what I'm trying to learn here. Edited December 22, 2023 by vanowm Quote
Steven P Posted December 22, 2023 Posted December 22, 2023 I tend to take the easy way out and your PS, an if or cond depending on the selection and the command - sometimes simple is quicker to program and can be as quick or a bit quicker in its execution (though for most speed gains or losses it is never enough to grab a drink). I'd be interested too to see what everyone else does. (As a side comment, I tend to submit 'simple' on the forum here, easier to follow and understand but there are usually more complex ways.... which is what you are asking) 1 Quote
lido Posted December 24, 2023 Posted December 24, 2023 In order to avoid "_y", set the variable "PEDITACCEPT" to 1. The value is saved in registry. Quote
Steven P Posted December 24, 2023 Posted December 24, 2023 9 hours ago, lido said: In order to avoid "_y", set the variable "PEDITACCEPT" to 1. The value is saved in registry. Remember if you change registry or other settings then record what they were before and change them back again as soon as possible so that any routine returns the users system to the state it was before Quote
Recommended Posts
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.