Jump to content
Sign in to follow this  
IanH

Stake Object Weirdness - third time lucky

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

Share this post


Link to post

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

Share this post


Link to post

I also am a heavy user of stake objects. I wish there was a way to auto number the stakes as I set them, ie. 1,2,3 or 100,102,103.

Share this post


Link to post

Thanks Miguel. I will update my tools to use those functions instead and can revert to show 2d symbol where not appropriate for site models such as feature heights relative to surrounding ground level rather than datum.

Share this post


Link to post

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

Share this post


Link to post

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

Share this post


Link to post

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

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

 

7150 Riverwood Drive, Columbia, Maryland 21046, USA   |   Contact Us:   410-290-5114

 

© 2018 Vectorworks, Inc. All Rights Reserved. Vectorworks, Inc. is part of the Nemetschek Group.

×