Jump to content

Selecting Lighting Devices by Channel Range


Recommended Posts

 


Based on an earlier script/post about selecting lighting objects by universe... http://[https://forum.vectorworks.net/index.php?/topic/102718-selecting-lighting-objects-by-universe/#comment-449004]

 

Is it possible to select lighting device by a range of channel numbers? For instance 101-103

Using the script from before, how would I loop through and parse the dialog a user enters.

 

import vs
vs.DSelectAll()
channelRange = vs.IntDialog("Enter a fixture number range", 1)
vs.SelectObj("INSYMBOL & INVIEWPORT & ('Lighting Device'.'Channel'='{}')".format(channelRange))


Any guidance would be appreciated..

Link to comment

Check out AutoPlotVW. This is just one of the many useful commands you can find in its roster. http://autoplotvw.com

 

Criteria can't accept a list of options. You can parse the input string, and if it's in the format (\d+)-(\d+), construct criteria that links something like:

((('Lighting Device'.'Channel'<='103') & ('Lighting Device'.'Channel'>='101')))

but that won't handle non-contiguous ranges the way AutoPlot can. Unless you want to develop the script for learning purposes or as a step for a more complex script, AutoPlot will be well worth the potential hours spent.

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