Jump to content
Developer Wiki and Function Reference Links ×

GetPt & GetPtL crashes VW


Recommended Posts

Can someone explain why this simple program is crashing my VW? No matter if I change the varible 'pt' to POINT or VECTOR, or if I change the GetPtL to GetPt, it still crashes. On execution of the script it rubberbands a line to my cursor and waits for the next point. After clicking on the screen which should complete the execution of the script, my PIO icon still appears to be depressed and my pull down menus are greyed out. So I click three more random places on the screen and VW crashes. Even the example script for GetPtL on the http://developer.vectorworks.net page crashes my VW. I've tried restarting my computer, zapping the P Ram, still nothing seems to help. Is it just me or does it happen for you too?

PROCEDURE TEST2;

VAR

pt: POINT;

BEGIN

GetPtL(0,0,pt.x,pt.y);

END;

RUN (TEST2);

Link to comment

The script is simple and should not crash VW. I tried it from a Script palette and it worked as expected. I also tried it as a Menu command and it worked there, too. Even as a tool, it worked, but it should be noted that tools wait for an initial click in the drawing to begin execution, so there will be an extra click in your script, the first activates the tool, the second gets the point for GetPtL(), and then the tool goes back into waiting mode so the tool icon will remain dark (depressed) until it is deselected.

You say you have this in a PIO. could you elaborate more? Point, Path(2D/3D), Linear, Rectangular? I suspect there is another cause beyond this call causing the crashes.

Raymond

Link to comment

Raymond: I got the same results you did when applying the script to a Menu command or tool in the script palette, but it still locks up and crashes when I try using it in a Point or Rectangular PIO. I've also tried the script in VWv10 Designer with the same result.

Miguel: You might be on to something. Maybe the GetPt and GetPtL commands were never meant to be used in a PIO. Could it be that the GetPt command can't translate the real world coordinates with the relative coordinates system of the PIO? That would seem strange but you never know. I'm using this command in a PIO to reestablish a central reference point it uses so that the user can refine the PIO to the needs of the project.

Link to comment

I understand. Our company does a lot of corporate events (large business meeting) that at times want the audience to be seated around the stage in a circular pattern. I'm writing a script that does that. The most important reference point of this script is the center of the circular seating, which is determined by the first click of the rectangular PIO. The second most important point is how far out from the center point you want the seating to start from, that's the point that I want the user to determine using the GetPtL command. I could ask the user to type in this distance as a dimension, but I would rather have the user just click on the screen where they like it to begin for ease of use.

Let me know if that helps or if you need me to clarify anything.

Link to comment

If you want the seating origin to always be a dragable handle, you can add a control point parameter.

It sounds like you may also want two plug-ins -- a PIO for drawing the seating, and a separate tool plug-in for placing the PIO (eg. collect user clicks, insert PIO, use SetRField to set distances in the PIO). The user would use the custom tool to insert the PIO in the drawing rather than using the PIO itself (PIOs are sort of pseudo-tools in palettes. You can place a PIO in a palette as a sort of dedicated symbol insertion tool for that PIO, but its user clicks and insertion behaviors are defined by the PIO type and not my your script.)

HTH,

Josh

Link to comment

Thanks Josh. This could work! Thanks for the suggestion. I've never used Control Points before, but playing with for just a little bit it looks like it could work.

I don't think I'll do the PIO inside a PIO thing. Sound a bit messy. Still would like to know why the GetPt or GetPtL doesn't work, but I guess I'll have to revisit that later. Thanks.

Link to comment

I understand. Our company does a lot of corporate events (large business meeting) that at times want the audience to be seated around the stage in a circular pattern. I'm writing a script that does that. The most important reference point of this script is the center of the circular seating, which is determined by the first click of the rectangular PIO. The second most important point is how far out from the center point you want the seating to start from, that's the point that I want the user to determine using the GetPtL command. I could ask the user to type in this distance as a dimension, but I would rather have the user just click on the screen where they like it to begin for ease of use.

I would create a line PIO with 1 or 2 control points. The first click to determine the midpoit and start of the first seating row and the second click to set the center of the arc. The first control point would be to set the beginning angle of the arc and maybe a second control point to set the end angle if the seating is not symmetrical about the midpoint.

Still would like to know why the GetPt or GetPtL doesn't work, but I guess I'll have to revisit that later.

It may be the way the PIO is designed. I know from experience that anytime you introduce an infinite loop in the PIO it will crash VW. I have a feeling that GetPt which goes through an event loop is timing out or is terminated after a set number of iterations.

Link to comment

Miguel,

I might use two control points. Once again, I always appreciate your input. Thanks.

Regarding the GetPtL saga, I only know enough about Vectorsript to get myself in trouble so I don't know if I can speak much into the "event loop" discussion, all I know is it doesn't make sense.

Always appreciative of your help, Thanks.

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