The Hamma Posted June 24, 2021 Share Posted June 24, 2021 Is there a script command to open the edit class dialog box. I would like to be able to edit the currently active class or a selected object's class without having to search the long list of classes in the class list. Quote Link to comment
Pat Stanford Posted June 24, 2021 Share Posted June 24, 2021 I don't believe there is a script command to open that dialog box. There is a command (DisplayOrganizationDialog) that would get you to the Classes pane of the organization dialog box, but I don't know how to select the class you want and click the Dialog box from there. You could make your own custom version of the Edit Class dialog box and then store all the collected values to the class, but it sounds like that is a lot more work than you were hoping for. I hope someone points out that I am wrong and there is a 2 line solution. Quote Link to comment
MullinRJ Posted June 24, 2021 Share Posted June 24, 2021 Hi @Pat Stanford , I've used that call in another script and it worked nicely. The following script is not a 2-liner, but it's still a simple approach. With no object selected, the dialog opens with the active class selected. For the case of editing an object's class, you just need to change the active class before opening the dialog, then restore the active class when done. For a more ubiquitous experience, Waldo's help must be enlisted. @The Hamma , This script should do what you want. If not, please write back. PROCEDURE EditClass; { Open the Organization Dialog and select the class of the first selected object, { or select the Active Class, if no object is selected. } { 24 Jun 2021 - Raymond J Mullin. } { THIS SCRIPT WAS ONLY WHIMSICALLY TESTED. NO WARRANTIES ARE EXPRESSED OR IMPLIED. } { Feel free to modify this script 'til your heart's content. } VAR H :Handle; ActiveCl, aClass :String; BEGIN ActiveCl := ActiveClass; { save current Active Class } aClass := ActiveCl; H := FSActLayer; if (H <> nil) then aClass := GetClass(H); { get class of selected object } NameClass(aClass); { set class to edit before dialog opens } DisplayOrganizationDialog(1); { show Classes tab } NameClass(ActiveCl); { restore active class to original state } END; Run(EditClass); Raymond 2 Quote Link to comment
The Hamma Posted June 25, 2021 Author Share Posted June 25, 2021 Thank you this works great!!! Quote Link to comment
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.