Jump to content
Developer Wiki and Function Reference Links ×

Get handle of object that data tag is associated with


Recommended Posts

Assuming you already have a handle to a DataTag, have you tried something like this?

   

PROCEDURE xxx;
{ Show association of selected object. }
VAR
	H, DataTagHand :Handle;
	assKind, assValu :Integer;
	
BEGIN
	DataTagHand := FSActLayer;
	H := GetAssociation(DataTagHand, 0, assKind, assValu);
	message('Assoc. Type = ', GetTypeN(H), '    Assoc. Kind = ', assKind, '    Assoc. Value = ', assValu);
	SysBeep;
END;
Run(xxx);


Raymond

Edited by MullinRJ
  • Like 1
Link to comment

Script to center selected space tags on associatied spaces.

 

PROCEDURE MoveSDTScript;

{script to center selected space tags on associatied spaces.  note if the handle for the space is
outside the boundry of the space the tag will be centered on the space and the bounding point}

VAR
h,h2	:HANDLE;
index,associationkind,value:INTEGER;
phx,phy,ph2x,ph2y:real;

FUNCTION MoveDT(h :HANDLE) :BOOLEAN;

BEGIN
h2:=GetAssociation(h,index,associationkind,value);
Hcenter(h,phx,phy);
Hcenter(h2,ph2x,ph2y);
HMove(h,ph2x-phx,ph2y-phy);
END;


BEGIN 
ForEachObjectInLayer(MoveDT,2,0,2);
END;

RUN(MoveSDTScript);

 

  • Like 1
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...