Jump to content

Edit active Class


Recommended Posts

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.

Link to comment

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

  • Like 2
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...