Jim Smith Posted February 10, 2004 Share Posted February 10, 2004 Does anyone know how to avoid the following situation? I have a series of polygons. I want to changes these polys. to lines. I change the view to "Active Class Only". Then select and change the polys. to lines. I select several lines and group the lines & the lines vanish. Change the class view to "View all classes" and the group of lines is back, but they are in the none class. Upon editing the group, the lines are still in the "old" class?! - What is happening? - Can I prevent this from happening or, do I just know about it & fix it as it happens. Quote Link to comment
Petri Posted February 10, 2004 Share Posted February 10, 2004 Groups are put in class 'None' regardless of the class(es) of their elements or your active class. Well, not to worry: the matter was discussed over a year ago and yours truly offered a solution in the form of a script: - the group is placed in the current active class unless - all its members are in the same class in which case the group inherits that class. If you have groups with over 1000 members, you will need to change the array limit from [1..1000] to, say, [1..10000]. Old habit from the time when MiniPascal did not release memory used by arrays: I have as small arrays as possible. Don't ditch the normal Group command if you handle very large groups: this script may be a tad slow, because it needs to do a lot more work. Hope it works! Copy between the {----------} lines, say 'Create Plug-In', click 'New', type a name (eg Super Grouper); choose 'Command', click 'Script', say 'Paste', click 'OK', click 'Done'. Then use the Workspace editor to install the command (it is in category Menu commands/Miscellaneous) and possibly a keyboard shortcut. {------------------------} PROCEDURE SuperGrouper; { ? Petri Sakkinen 2002-2004 } { -- This is freeware but you may not remove the ? notice. Use at your own risk.-- } VAR i, n : INTEGER; theClass, currentClass, prevClass : STRING; objClass : ARRAY[1..1000] OF STRING; obHd, gHd : HANDLE; allTheSame : BOOLEAN; PROCEDURE StoreObjectClass; BEGIN i := i+1; currentClass := GETCLASS(obHd); objClass := currentClass; IF NOT(prevClass = currentClass) THEN allTheSame := FALSE; prevClass := currentClass; END; PROCEDURE RestoreObjectClass; BEGIN SETCLASS(gHd, theClass); obHd := FINGROUP(gHd); WHILE obHd <> NIL DO BEGIN i := i+1; SETCLASS(obHd, objClass); obHd := NEXTOBJ(obHd); END; END; BEGIN i := 0; allTheSame := TRUE; theClass := ACTIVECLASS; obHd := FSACTLAYER; prevClass := GETCLASS(obHd); WHILE obHd <> NIL DO BEGIN StoreObjectClass; obHd := NEXTSOBJ(obHd); END; GROUP; i := 0; gHd := LSACTLAYER; IF allTheSame THEN SETCLASS(gHd, currentClass) ELSE RestoreObjectClass; END; RUN(SuperGrouper); {-------------------------------} [ 02-10-2004, 07:05 AM: Message edited by: Petri ] Quote Link to comment
Jim Smith Posted February 11, 2004 Author Share Posted February 11, 2004 Thanks, I guess the short answer is, know this will happen. Quote Link to comment
Vector In Vic Posted February 11, 2004 Share Posted February 11, 2004 Petri! Thanks a lot. This is something thats been bugging me for years. cheers... 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.