Jump to content
Developer Wiki and Function Reference Links ×

Help with xyz information


Damo

Recommended Posts

Im structural engineer who is creating a drawing showing piles (a symbol). I would like to link the insertion coordinates of each pile (Labelled P1, P2 etc. into a worksheet. This worksheet would show Pile ref: (P1) and then the x and y insertion coordinatesof the symbols. can anyone help me please (not that great with scripts !)

Link to comment

No scripting needed - you can just use the worksheet (report) to get the locations. Depending on the design of symbols, different functions are needed, but I would suggest a design where =XCENTER and =YCENTER provice correct results. Labelling is best handled with a data record, so you can show the numbers on the drawing with linked text.

Link to comment

Sorry, Damo - not with worksheets and symbols, but if instead of symbols you would use (simple) parametric objects, they would work (via a data record.)

The script of the PIO might be something like this:

code:

{ -------- START SCRIPT -------- } 

PROCEDURE xyMarker; { ? Petri Sakkinen 2002 - 2004 }

CONST

rName = 'refdata'; { the name of the data record you wish to use }

xField = 'xCoord'; { and the names of the fields }

yField = 'yCoord';

lineLength = 500mm; { modify constants so the size suits you }

textX = 700mm; { ditto with tag locations }

textY = 700mm;

VAR

x, y, xo, yo : REAL;

me, rHd, wHd : HANDLE;

myName, xCoord, yCoord : STRING;

ok : BOOLEAN;

BEGIN

ok := GETCUSTOMOBJECTINFO(myName, me, rHd, wHd);

SETOBJECTVARIABLEBOOLEAN(me, 800, TRUE);

GETSYMLOC(me, x, y);

x := x - PXREF; { we have parameters for coordinate reference }

y := y - PYREF; { point in case of a specific local coord origin }

xCoord := NUM2STRF(x);

yCoord := NUM2STRF(y);

SETRECORD(me, rName);

SETRFIELD(me, rName, xField, xCoord);

SETRFIELD(me, rName, yField, yCoord);

xCoord := CONCAT('x ', xCoord);

yCoord := CONCAT('y ', yCoord);

MOVETO(-lineLength, 0); { crosshair lines }

LINETO(lineLength, 0);

MOVETO(0, lineLength);

LINETO(0, -lineLength);

TEXTORIGIN(textX, 0);

CREATETEXT(yCoord);

SETTEXTVERTICALALIGN(LNEWOBJ, 3);

SETTEXTJUST(LNEWOBJ, 1);

TEXTORIGIN(0, textY);

TEXTROTATE(90);

CREATETEXT(xCoord);

SETTEXTVERTICALALIGN(LNEWOBJ, 3);

SETTEXTJUST(LNEWOBJ, 1);

END;

RUN(xyMarker);

{ -------- END SCRIPT -------- }
[/code]

The PIO properties must be 'Reset on move'. Note that you only need to modify the constants to customise the marker a bit, like size & the record/fields you wish to use.

Note also that this only does x & y, but you can easily add z with function GETSYMLOC3D(me, x, y, z) and by adding a third text creation/data writing module.

[ 10-22-2004, 09:09 PM: Message edited by: Petri ]

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