Anton3210 Posted October 1 Share Posted October 1 I´m fairly new to vectorworks. I´m quiete experienced in programming. Im trying to write some, in my understanding, quite simple and small scribts. It isn`t clear to me neither from Marionette nor from the Python Function References how to get an reference to an Selected Object or to all the object or to any object in your Document. Is it nor intended to write code that works with Information already in the Project or did i just didn't look in the right place? Quote Link to comment
Pat Stanford Posted October 1 Share Posted October 1 The concept is called Handles in Vectorscript. And since Python in Vectorworks is really just a wrapper to Vectorscript, the concept applies in Python as well. In the Vectorscript Function Reference. Sort by Class and look in the Document List Handling section. vs.FSActLayer will return a handle to the first selected object on the active layer. vs.NextObj/vs.NextSObj/vs.PrevObj/vs.PrevSObj will let you "walk" the object tree. There are also calls that will return a hand the an object by Name or by Criteria about the object. Take a look in the Vectorscript and Python sections of the forum for lots of example code. Or post more about what you need your script to do and you will probably get lots of suggestions on how to approach it. IMNSHO, Marionette is better for creating object and scripts are better for modifying objects already existing. Especially if you already have some programming experience. Quote Link to comment
Anton3210 Posted October 2 Author Share Posted October 2 I want to add some functionality for the event Sector. Getting Hoist data is not listed in the Vectorworks scribt appendix. Am i right that i have to set up an sdk and use C++ to access those Objects? Quote Link to comment
Pat Stanford Posted October 2 Share Posted October 2 I have not tried, but I believe you can get Hoist date in Vectorscript/Python. Hoists are just Plugin Objects, so you can use the GetParametricRecord commands to get a handle to the record that contains the hoist data. GetName on that Handle will give you the name of the Record. From there you can use the GetRField and SetRField commands to access the individual fields. HTH 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.