John P Posted January 3, 2002 Share Posted January 3, 2002 VW8.5.1 on G4. Using "Custom Tool/Attribute", I am trying to create a tool so that all our staff will create walls in the same pen, fill type, line type and class.When I run the created script, it changes the active class, pen etc correctly, but stops when it trys to select the wall tool. I have to sit clicking the mouse and after between 2 and 10 seconds wall preferences dialogue is eventually displayed. Often it does not even get this far and the machine hangs.I have tried a script without the tool option selected and that works fine, changing the class, colours etc with no problems. How can I get the script to change active settings and then select a tool without hanging the machine? (Please excuse my ignorance. Although we have been using Vectorworks for a long time, we have only just begun setting up scripts to standardise our work.) Quote Link to comment
Hannes Posted January 3, 2002 Share Posted January 3, 2002 i don't really know what might going on, but maybeupdating to the (free) V. 8.5.2 might help? Also if you want feel free to sending me the script and i'll take a look at it. -Hannes Quote Link to comment
John P Posted January 3, 2002 Author Share Posted January 3, 2002 Thanks very much Hannes, I'll send script for you to look at for us, if you don't mind. John. Quote Link to comment
Hannes Posted January 3, 2002 Share Posted January 3, 2002 Hello John, Maybe you'r wall tool wasn't active if you run the custom tool command. Your code includes this line: CallTool(-128); -128 is the tool constant for the 2d selector.If you change the number into CallTool(-208); your script will call the wall tool. I hope this helps.Kind regards,Hannes Quote Link to comment
John P Posted January 3, 2002 Author Share Posted January 3, 2002 You are quite right Hannes, I'm sorry I sent wrong script! This is the one which was playing up (any other ideas?) Thanks very much, John. Procedure CustTool;VAR Name:STRING;Result:BOOLEAN;BEGIN PushAttrs;ClearCavities;PenSize(7);PenPat(2);AddCavity(TRUE, 5.3937008", 1.4566929", 35);PenSize(7);PenPat(2);AddCavity(TRUE, -5.3937008", -1.4566929", 35);DoubLines(0");PenSize(7);PenPat(2);SetZVals(0", 0");FillFore(255);FillBack(0);FillPat(1);PenFore(255);PenBack(0);PenPat(2);PenSize(7);PenPat(2);Marker(0, 0.125000, 15); NameClass('Walls');CallTool(-208);PopAttrs;END;Run(CustTool); Quote Link to comment
Hannes Posted January 3, 2002 Share Posted January 3, 2002 quote: Originally posted by John P: You are quite right Hannes, I'm sorry I sent wrong script! This is the one which was playing up (any other ideas?) Thanks very much, John.Procedure CustTool;VAR Name:STRING;Result:BOOLEAN;BEGIN PushAttrs;ClearCavities;PenSize(7);PenPat(2);AddCavity(TRUE, 5.3937008", 1.4566929", 35);PenSize(7);PenPat(2);AddCavity(TRUE, -5.3937008", -1.4566929", 35);DoubLines(0"); {<<<set here your wall thickness, then it works. PenSize(7);PenPat(2); SetZVals(0", 0"); {<<<Attention, this line set's the layer's Z-values, in this case to zero.If you WANT to change the Layers Z-value trought this script then fill in the proper values, if not delete this line FillFore(255);FillBack(0);FillPat(1);PenFore(255);PenBack(0);PenPat(2);PenSize(7);PenPat(2);Marker(0, 0.125000, 15); NameClass('Walls');CallTool(-208);PopAttrs;END;Run(CustTool); Kind Regards,Hannes [ 01-03-2002: Message edited by: Hannes ] Quote Link to comment
Sir_Dan_Fortesque Posted January 4, 2002 Share Posted January 4, 2002 Hi, In the past we had the same problem as your script. Firstly, maybe it is a good idea to use SetTool instead of CallTool (at least this solved the problem for us). Secondly the number to use is -208 for the wall tool not -128. I will take a closer look at your code in the weekend, and I will try it. In the meantime have a nice weekend. Friendly greetings, StarGate Quote Link to comment
StarGate Posted January 6, 2002 Share Posted January 6, 2002 Hello John, As promised I look at your code and I found out which could be the cause of your error. You have to remove two instructions of your code : pushattrs;popattrs; The first instructions saves your environment the second restores them to the state where pushattrs is called. I try this at my home with VectorWorks 9.5.2 Dutch version. It is very foolish of me that I did not see that earlier because in the past I ran into the same problem. I adjusted your code and you will find it under this text. I wish you very much success and a very nice day. With friendly greetings, StarGate Procedure CustTool;VAR Name:STRING;Result:BOOLEAN;BEGIN ClearCavities;PenSize(7);PenPat(2);AddCavity(TRUE, 5.3937008", 1.4566929", 35);PenSize(7);PenPat(2);AddCavity(TRUE, -5.3937008", -1.4566929", 35);DoubLines(0"); {<<<set here your wall thickness, then it works. PenSize(7);PenPat(2); SetZVals(0", 0"); {<<<Attention, this line set's the layer's Z-values, in this case to zero.If you WANT to change the Layers Z-value trought this script then fill in the proper values, if not delete this line } FillFore(255);FillBack(0);FillPat(1);PenFore(255);PenBack(0);PenPat(2);PenSize(7);PenPat(2);Marker(0, 0.125000, 15); NameClass('Walls');CallTool(-208);END;Run(CustTool); Quote Link to comment
StarGate Posted January 6, 2002 Share Posted January 6, 2002 Hello again, Sorry I made a mistake in the version number of Vectorworks. I wrote 9.5.2 Dutch edition which was faulty. It has to be 8.5.2 Dutch edition. Friendly greetings, StarGate Quote Link to comment
John P Posted January 7, 2002 Author Share Posted January 7, 2002 Thanks very much Hannes, Sir Dan, Stargate. I'll try and see if I can get it working. I'm glad theres so many helpful people watching this forum! 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.