The Hamma Posted April 29 Share Posted April 29 In a vectorscript, does anyone know how to get the handle of an object that a data tag is associated with. Specifically I am trying to get the handle to a space from selecting the data tag for that space. Quote Link to comment
MullinRJ Posted April 29 Share Posted April 29 (edited) 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 April 29 by MullinRJ 1 Quote Link to comment
The Hamma Posted April 29 Author Share Posted April 29 5 hours ago, MullinRJ said: Assuming you already have a handle to a DataTag, have you tried something like this? That is it, thanks. Quote Link to comment
The Hamma Posted April 29 Author Share Posted April 29 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); 1 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.