Jump to content

Getting Handle to Light Position Obj


Recommended Posts

If I can get the name of a Light Position Obj (LPO)(Hanging Position), how can I get a handle to the LPO.  Is the only option to cycle through all the LPOs until I find a match using a "ForEachObject() and GetRField(LPO, 'Light Position Obj', 'Position Name')?  GetObject(name) won't work, because the name is not put in the "Name" field at the bottom of the LPO instance's OIP.

Link to comment

Typed in the forum and not tested, but you should get the idea.

 

Procedure Test;
Var	HandleToLPO	:Handle;

Procedure Execute(Hd1:Handle);
Begin
 HandleToLPO:=Hd1;
End;

Begin
 ForEachObject(Execute,('LightPosition Obj'.'Position Name'='YourLPONameHere'));
 Message('The Handle to the LPO is: ',HandleToLPO);
End;

Run(Test);

 

Link to comment

Using " 'LightPosition Obj'.'Position Name'='YourLPONameHere' " as a criteria is new and exciting.  I was expecting to have to use a selection criteria like " ((R IN ['AP Light Position Obj'])) ".  I can simplify many things by specifying record field values in the callback.   Off to test now.

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