Jump to content

Stake Object Weirdness - third time lucky


IanH

Recommended Posts

Looks like my previous duplicated post suffered as a result of the board downtime glitch and are not visible.

So third time lucky with this is my definitive question.

I am a regular user of the stake object and have noticed enough oddities/inconsistencies with it in the past to have to rewrite some of the VW functionality (specifically import survey file) that operates on it just to work around the problems.

Having recently moved to 2011 and updated some of my scripts, I cant find a work around to either of these issues. I suspect that they were not 2011 or script related specifically, just that I have spent a significant amount more time in 2011 in testing.

1. When moving cursor near stake object insertion point, it invariably snaps onto the endpoints, along line snaps etc of the stake object shape - ie style cross, making it difficult to quickly and accurately draw an object at the insertion point of the symbol. I don't care that a stake may be made up of lines, I just want the snaps that are relevant to the stake object. I think this possibly got worse in 2009-2011, possibly with more irrelevant snaps available?

2. When using Vectorscript to determine the X/Y coordinates of the stake object using vectorscript Get3dCntr, if in 'include as site model data' mode, then this correctly returns the X,Y,Z coordinates of the stake objects insertion point, however in 'Use as 2|D graphic only' mode, then it appears to return a point, possibly central to the stake rather than the insertion point. So there is an inconsistency in returned values of the Get3dCntr function between a stake object in the different modes.

Any setting that I missed for 1 and is 2 a bug or by design and if by design, what is the correct way of getting the X,Y of the insertion point?

Thanks

Edited by IanH
Link to comment

1. Actually this has always been a problem depending on the zoom factor. I made my own stake object due to the limitations of the stock one and added a locus at the top so it does not matter the zoom factor it will always pick the topmost object in the pio and if there are other objects nearby I can locate the stake origin by the label "locus".

2. For plug-ins, the origin can be found with:

PROCEDURE GetSymLoc(pioHndl:HANDLE; VAR x,y:REAL);

or

PROCEDURE GetSymLoc3D(pioHndl:HANDLE; VAR x,y,z:REAL);

Link to comment
  • 2 weeks later...

Hi Miguel

I have just got around to changing Get3dCntr to GetSymLoc3D and found that the resulting points are considerably (meters) offset from the results given by Get3dCntr.

However, using GetSymLoc yields the correct answer. For the time being, I can use the non 3D function, as this gets around the original issue of inconsistencies between the different modes of the stake object, but when I fully expand my tool to use3D space, I'm going to be back at square one.

Is there any reason why

PROCEDURE GetSymLoc(pioHndl:HANDLE; VAR x,y:REAL);

or

PROCEDURE GetSymLoc3D(pioHndl:HANDLE; VAR x,y,z:REAL);

would yield different results for X and Y for the same stake object?

Thanks

Link to comment

I tested both procedures with the following script:

PROCEDURE TestPioLoc;
VAR
objHdl: HANDLE;
origPt1,origPt2: POINT3D;
BEGIN
objHdl:= FSActLayer;
IF objHdl <> NIL THEN
BEGIN
GetSymLoc(objHdl,origPt1.x,origPt1.y);
GetSymLoc3D(objHdl,origPt2.x,origPt2.y,origPt2.z);
Message('GetSymLoc = ',origPt1.x,', ',origPt1.y,
   ' & GetSymLoc3D = ',origPt2.x,', ',origPt2.y,', ',origPt2.z);
END;
END;
Run(TestPioLoc);

and got the same coordinates so I do not know why you would get different results. I tested on the stake object and the custom pio I created and got the correct coordinates on both. Note that I did all the testing in VW 2008 so I hope is not a bug in 2011

Link to comment

It may be broken or I may be doing something stupid...

For a default stake object at X=13774, Y=11374, Z=0 and running your script I get:

GetSymLoc = 13774.2, 11374.4 & GetSymLoc3D = 3700, 4200, 0

Having recently upgraded from 2009, its not as if I am up with the intricacies of layer planes and screen planes, but no matter what I set, I don't get anything matching the 3700, 4200 values. Although Z appears to be correct if I change the value in the OI.

If I create another stake, X=12100, Y=12900, Z=100 on 3D plane, then I get:

GetSymLoc = 12099.8, 12899.6 & GetSymLoc3D = 2025.6, 5725.2, 100

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