sandertb Posted December 3, 2021 Share Posted December 3, 2021 Hi,  Im working on a python tool that will draw something on a 3D path, but I'd like the path to be displayed as a polyline instead of curves when drawing the path. See attached image for what i do not want 🙂 Does anybody have a clue how I could approach this?  Thanks! Quote Link to comment
JBenghiat Posted December 3, 2021 Share Posted December 3, 2021 Any 2D or 3D path-based object is going to use the polyline tool or the NURBS tool, respectively, to draw the path, and will respect the options in the more bar. For 2D, you can select the point vertex mode, and for 3D set the NURBS degree to 0. You can't force the mode. You could write a custom tool for placing the PIO that only draws polygons, though that adds a significant amount of complexity to your project. Quote Link to comment
sandertb Posted December 9, 2021 Author Share Posted December 9, 2021 Thanks for the reply. Where could I set the Nurbs degree to zero when drawing the path? Quote Link to comment
JBenghiat Posted December 10, 2021 Share Posted December 10, 2021 In the mode bar, click the icon all the way on the right. This gives you a dialog for entering the degree.  https://app-help.vectorworks.net/2021/eng/index.htm#t=VW2021_Guide%2FShapes2%2FCreating_NURBS_curves.htm Quote Link to comment
sandertb Posted December 13, 2021 Author Share Posted December 13, 2021 Thanks! Is there also a way to set this in Python? Quote Link to comment
JBenghiat Posted December 14, 2021 Share Posted December 14, 2021 How are you creating the path? If it’s a 3D path object with the built-in creation tool, you have the same options in the mode bar. If you’re creating the path through some other means, CreateNurbsCurve() lets you set the degree. Quote Link to comment
sandertb Posted December 15, 2021 Author Share Posted December 15, 2021 I believe I am using the built-in tool 3D Path tool for python. The reason I'd like to set the options through python is that this plugin will be distributed to all VWX engineers in the company, and it would be ideal if all the settings would be set by default. Would this be possible? Â Quote Link to comment
JBenghiat Posted December 15, 2021 Share Posted December 15, 2021 Python/vs does not have a way to change tool defaults and the NURBS degree doesn’t appear to be something that’s a program preference.  The option that gives you then most control would be to create a custom tool for acquiring the 3D points that define the path.  In theory, the NURBS tool preference gets written to your user preferences, and you can try searching the xml file for the value. You can then access with Get/SetSavedSettings(). But your code isn’t going to run before you place your first object, so your users would have to run a command to set the settings before inserting the object for the first time. Quote Link to comment
sandertb Posted December 20, 2021 Author Share Posted December 20, 2021 Thanks so much for helping Joshua! 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.