Jump to content
Developer Wiki and Function Reference Links ×

Handle to Object Matching Search Criteria


Recommended Posts

Hi all,

Just wondering if someone can give me a rundown on handles in relation to search criteria.

At the moment I have 4 rectangles with a record called 'Dimming Info'. There are only two fields in this record thus far called 'Name' and 'Type'. At the moment the rectangles are labelled 'Dim 1', 'Dim 2', 'Dim 3' and 'Dim 4' in their name field with misc data in type. At a later stage I want to copy data from additional fields within this record using the GetRField() command.

My thought process was to define a specific search criteria and then select the object:

{Set Criteria where DIMLBL is user input string of name eg. Dim 1}

criteria:=concat('(''Dimming Info''.''Name''='',DIMLBL,''')');

{Select said criteria}

SelectObj(criteria);

{Handle to dimmer as first selected object}

DIMHNDL:=FSActLayer;

{Take info from said handle and record into dimType (String)}

dimType:=GetRField(DIMHNDL,'Dimming Info','Type');

This seems to work on some searches really well but then the next search (running the script again) seems to either save the previous values and print those or print nothing at all. I have a feeling =FSActLayer is the problem but just can't quite get there.

Any help much appreciated.

Cheers,

James

Link to comment

I think you can fix this by adding a DSelectAll; at the beginning of the script.

I have not tried your script, but it appears that the first time through it will select and object and return that object.

The second time it will add a second item to the selection, but the first selected item will be the one from the first run.

Let me know if you have other questions.

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