Jump to content
Developer Wiki and Function Reference Links ×

Selection help


Recommended Posts

Ok, so I am atempting to write my first vectorscript, but im a little lost as to where to start.

My script is meant for spotlight, and what i want it to do is select all my instruments, and accessories, etc and copy the x coordinate to a user field for export.

So I know what i want it to do, I just can't figure out how to select the instruments. without getting an error.

Link to comment

...and then you save the custom selection script and paste it into your main script. It could have a line something like

R IN ['Instruments', 'Accessories', ' etc']

were 'R' is for Record Format.

I'd probably use one of the "FOREACHOBJECT" -constructs. While these are definitely in the deep end for someone writing their first script, it is better to learn to write good, structured scripts.

Having said that: if you have an exclusive custom selection, you can process the objects with

objectHandle := FSACTLAYER;

WHILE NOT(objectHandle = NIL) DO BEGIN

{do stuff}

objectHandle := NEXTSOBJ(objectHandle);

END;

There are indeed situations when selection and processing need to be separated.

The quite clever bit with the above assignments is that the first one implies the criterion to be used in the latter one: selected objects on the active layer.

Getting a handle of handles is extremely important...

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