Jump to content
Developer Wiki and Function Reference Links ×

Changing name to a plugin command


Recommended Posts

Hi guys

Happy new year first of all

I'm writing various simple commands in VS to automate repetitive tasks

They move and rotate the 2D and 3D selected objects to the origin

 

Everything works fine with the scripts, but when I put them into the command plugin, they become apparently randomly grayed

I've tried to reproduce the situation, but unsuccesfully

Doesn't matter if I change the rules of selection or view

Made some tries both with 2024 and 2023 ITA, but no way

Made something wrong?

 

If someone wants to make some tries, he can find the commands attached

Ruota 2D.vsm Ruota 3D.vsm Ruota Sx.vsm Trasla 2D.vsm Trasla 3D.vsm

Edited by erminio
Link to comment

I have downloaded and tried the Route 2D and see the same thing you do. It is greyed out in the menu.

 

I copied the script and pasted it into a new Menu Command PIO and it ran fine.  Did you set the type of PIO to Menu Command or something else?

 

Also, you want to be careful in making PIOs with variable names that start with the letter P.  Once they become Plugins, things that start with p are considered Parameters.

 

HTH

  • Like 1
Link to comment

There are a couple of things getting in your way.  The biggest thing has to do with your Availability Options.  These determine when your command can be run, and the settings you have set up are fairly restrictive:

image.thumb.png.6514daab8ba8be739a75e30acf303f31.png

 

The setting that is tripping you up is requiring Selection has 2D.  This means that the command can only be run on Screen Plane objects, and you have Selection has 3D set to prohibit, so the command can never be run on objects on the Layer Plane.  If you set these both to Ignore, the command will work correctly.

 

That being said, I think there is something of a bug in Vectorworks that I never noticed before.  Changing any of the Availability Options does not show any effect until Vectorworks has been restarted.  This was tripping me up for a while, as I recognized immediately that this was an issue with Availability Options, but making changes didn't seem to have any affect.  I set all to Ignore, then restarted Vectorworks on a whim.  Suddenly the command worked perfectly.  I reset Object Selected to Require and the command worked even with nothing selected.  Restarted and then got the expected results.  I think this is the only instance where changing the Plug-in Definition requires a restart aside from changing the name (and that only affects the Workspace, the command will continue working correctly until restarting Vectorworks, which will require resetting the Workspace to see the new plug-in name).

 

I understand that the Selection has 2D / Selection has 3D nomenclature here is confusing.  If you want the script to only work on planar objects, you will need to add in a check of some kind to your code.  One such could be through the use of IsPlanarObj.

  • Like 3
Link to comment
11 hours ago, Pat Stanford said:

I have downloaded and tried the Route 2D and see the same thing you do. It is greyed out in the menu.

 

I copied the script and pasted it into a new Menu Command PIO and it ran fine.  Did you set the type of PIO to Menu Command or something else?

 

Also, you want to be careful in making PIOs with variable names that start with the letter P.  Once they become Plugins, things that start with p are considered Parameters.

 

HTH

Thanks Pat for help

No particular settings

I forgot that thing of words starting with p, but there are no parameters in that PIO

Link to comment
9 hours ago, Jesse Cogswell said:

There are a couple of things getting in your way.  The biggest thing has to do with your Availability Options.  These determine when your command can be run, and the settings you have set up are fairly restrictive:

image.thumb.png.6514daab8ba8be739a75e30acf303f31.png

 

The setting that is tripping you up is requiring Selection has 2D.  This means that the command can only be run on Screen Plane objects, and you have Selection has 3D set to prohibit, so the command can never be run on objects on the Layer Plane.  If you set these both to Ignore, the command will work correctly.

 

Thank you Jesse!

Really well done

You saved me hours of works and headache

 

9 hours ago, Jesse Cogswell said:

That being said, I think there is something of a bug in Vectorworks that I never noticed before.  Changing any of the Availability Options does not show any effect until Vectorworks has been restarted.  This was tripping me up for a while, as I recognized immediately that this was an issue with Availability Options, but making changes didn't seem to have any affect.  I set all to Ignore, then restarted Vectorworks on a whim.  Suddenly the command worked perfectly.  I reset Object Selected to Require and the command worked even with nothing selected.  Restarted and then got the expected results.  I think this is the only instance where changing the Plug-in Definition requires a restart aside from changing the name (and that only affects the Workspace, the command will continue working correctly until restarting Vectorworks, which will require resetting the Workspace to see the new plug-in name).

 

I've made me too all these tries, changing the availability options and restarting Vectorworks every now and then, but never notice that thing, also because I worked in files with legacy 2D functions disabled

 

9 hours ago, Jesse Cogswell said:

 

I understand that the Selection has 2D / Selection has 3D nomenclature here is confusing.  If you want the script to only work on planar objects, you will need to add in a check of some kind to your code.  One such could be through the use of IsPlanarObj.

 

Yes that thing of talking about 2D objects instead of Layer plane is quite misleading

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