Martin Crawford Posted October 11, 2019 Share Posted October 11, 2019 What is the best way to count the number of plug-in objects in a drawing. I tired the following, however it always returns 1 crit = "N='Create Processor'" processorCount = int(vs.Count(crit)) Thanks Quote Link to comment
JBenghiat Posted October 11, 2019 Share Posted October 11, 2019 The criteria builder in the VectorScript editor can be useful for this. To count a specific plug-in, use PON=‘Plug-in Name’. To count all plug-ins, use T=PLUGINOBJECT. Quote Link to comment
Pat Stanford Posted October 11, 2019 Share Posted October 11, 2019 Joshua is correct. As always. But perhaps a little more detail will help. The =N returns the Name of the object. This is the name that you can type into the OIP. I think it also returns the "source" object for PIOs and Symbols. VW is very picky about names and only one object in a file can have a specific name. You can't have a class named Door in a file that has a Door object in it. Your script retuned 1 because there is only 1 object with that name in the file. It is the definition of the PIO. PON to return the plug-in name or S to return the symbol name are usually better options for criteria. 1 Quote Link to comment
Martin Crawford Posted October 11, 2019 Author Share Posted October 11, 2019 Works Perfectly. Thanks Martin 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.