IanH Posted May 22, 2008 Share Posted May 22, 2008 My first bit of Vectorscript so please be patient. But I do have 25 years commercial Pascal behind me so I hope I will pick it up quickly Basically, I want to manipulate stake object in Z direction. Two questions. 1. I can get Z data from a stake object handle using Get3dCntr but how do I change Z value? Do I have to move the object and if so, will this work in all orientations or just when I am in plan view. 2. I wish to get the style of the stake object. I have an object handle (there are multiple stake objects selected at this point and I am traversing them) and I know its probably very simple, but how do I access the style parameter when all I have is an handle to the stake object. SelectObj((INSYMBOL & INVIEWPORT & (PON='Stake Object') & (SEL=TRUE))); datumObj := FSActLayer; { ... Various error checking omitted for clarity } datumLayer := GetLayer( datumObj ); datumClass := GetClass( datumObj ); Get3dCntr( datumObj, dx, dy, dz ); { ??? datumStyle := id#3, 'style', type popup ???; } { ??? Set3dCntr( datumObj, dx, dy, dz + offset ); } Thanks Quote Link to comment
IanH Posted May 22, 2008 Author Share Posted May 22, 2008 MOve3dObj allows me to move the object successfully. Seems to be fine when I tested it in an oblique view. Which leaves reading the field value from a handle to stake object. Quote Link to comment
Pat Stanford Posted May 22, 2008 Share Posted May 22, 2008 Something like: String1 := GetRField(H1,'Stake Object','Style'); Will get the setting from the record SetRField(H1,'Stake Object','Style','Triangle'); Will change the value attached to the object pointed to by handle H1. Pat Quote Link to comment
IanH Posted May 22, 2008 Author Share Posted May 22, 2008 Thanks Pat. I knew it would be easy. Quote Link to comment
IanH Posted May 23, 2008 Author Share Posted May 23, 2008 I'm pleased with my first attempt. Its certainly given me the urge to try more. Is it general etiquette for people to post their initial attempts for critique? My script normalises stake objects around a selected datum. So if you take a survey and have an initial datum of 0 then decide that you want to shift the datum to say 10M or 50M, then the script will move/normalise the other similar stake objects. It also works vice versa, if you have a survey with datum at a particular value, you could if you wish shift the datum back to 0. This is really aimed at garden designers who take their own surveys rather than importing from professional surveys where spot heights are recorded in a different way. Quote Link to comment
Pat Stanford Posted May 23, 2008 Share Posted May 23, 2008 It is certainly acceptable to put up a script for comments. If it is longer than a couple of pages, you might not get much response though ;-) You could also post it in the VS sharing forum. Pat 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.