Jump to content
Developer Wiki and Function Reference Links ×

Script hangs Mac if Wall tool selected.


John P

Recommended Posts

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.)

Link to comment

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

smile.gif" border="0

Link to comment

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);

Link to comment

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

smile.gif" border="0

[ 01-03-2002: Message edited by: Hannes ]

Link to comment

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

Link to comment

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);

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...