CARMELHILL Posted May 20, 2004 Share Posted May 20, 2004 My plug in for picking a class or layer to hide isn't working. Can anyone familar with scripts looks at the following for a conflict with version 11? These tools are similar to the tools in Autocad 14's old "Bonus Tools". They are so basic I'm amazed they don't come standard in VW...unless I am missing something. Thamk you... Hide class script Procedure show_hideClass; VAR pX, pY:REAL; Objekth: HANDLE; CurrentClassStr,ClassToHideStr:String; Begin GetPt(pX, pY); Objekth:=PickObject(pX, pY); IF Objekth<>NIL Then Begin CurrentClassStr:=ActiveClass; ClassToHideStr:=GetClass(Objekth); IF ((GetCVis(ClassToHideStr))=-1) THEN Begin ShowClass(ClassToHideStr); AlrtDialog(Concat('The Class *',ClassToHideStr,'* is set to visible')); END ELSE Begin HideClass(ClassToHideStr); AlrtDialog(Concat('The Class *',ClassToHideStr,'* is set to invisible')); END; NameClass(CurrentClassStr); IF (CurrentClassStr=ClassToHideStr) & ((GetCVis(ClassToHideStr))=-1) THEN AlrtDialog('you have set the active Class to Invisible. Select a different Class in the menu bar to take effect of this action'); END ELSE AlrtDialog('No Object selected'); Redrawall; END; And now the hide layer script Procedure show_hideLayer; VAR pX, pY:REAL; Objekth: HANDLE; CurrentLayerStr,LayerToHideStr:String; Begin GetPt(pX, pY); Objekth:=PickObject(pX, pY); IF Objekth<>NIL Then Begin CurrentLayerStr:=GetLName(ActLayer); LayerToHideStr:=GetLName(GetLayer(Objekth)); Layer(LayerToHideStr); IF ((GetLVis(GetLayer(Objekth)))=-1) THEN Begin ShowLayer; AlrtDialog(Concat('The Layer *',LayerToHideStr,'* is set to visible')); END ELSE Begin HideLayer; AlrtDialog(Concat('The Layer *',LayerToHideStr,'* is set to invisible')); END; Layer(CurrentLayerStr); IF (CurrentLayerStr=LayerToHideStr) & ((GetLVis(GetLayer(Objekth)))=-1) THEN AlrtDialog('you have set the active Layer to Invisible. Select a different Layer in the menu bar to take effect of this action'); END ELSE AlrtDialog('No Object selected'); RedrawAll; END; Quote Link to comment
Guest Posted May 20, 2004 Share Posted May 20, 2004 You should post this in the VS section or email vs_support@nemetschek.net Quote Link to comment
bohlr Posted May 21, 2004 Share Posted May 21, 2004 Carmelhill, Have you had anyfeed back on your script. I am a converted Autocad 14 user and have been looking to duplicate the functionality of the tools you referenced. Rick Bohl Quote Link to comment
Petri Posted May 22, 2004 Share Posted May 22, 2004 How about adding 'RUN' to both? No, I did not test, but the code seems to be OK in other respects. Or do you get syntax errors? However, eg. for just hiding classes the procedure could be simplified to work on a selected object (ie. the standard object-verb syntax) and shortened to HIDECLASS(GETCLASS(FSACTLAYER)); which is what I use when I sort out imported AutoCAD drawings with 300+ classes and don't need any fancy and time-consuming dialogs. (Yes, it is one line only, no procedure name, no 'Run'.) Anyway, on VectorDepot there are already several competing & complementing class management tool kits ( including some of mine which focus on the more esoteric CAD management aspects). I believe there are tools for the purpose of the above scripts. Quote Link to comment
CARMELHILL Posted May 23, 2004 Author Share Posted May 23, 2004 Thank you Petri. I was hoping to get one that would allow me to pick the tool first and then selected all the classes that I wanted to hide. I will check the VectorDepot. Quote Link to comment
Petri Posted May 24, 2004 Share Posted May 24, 2004 Carmelhill, Your class tool works: I finally tested it. The layer tool should also work as it looks to be OK. The tool does not at present 'stay on' - you need another loop for the functionality you seem to want. 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.