Tomas Posted August 2, 2019 Share Posted August 2, 2019 Hello,  I'm new to the Vectorworks scripts world, so some of terms that I use may be incorrect, or this problem has already been explained in other topics (if that is the case, I couldn't find sorry 😓) My problem is: I have a PIO that I want to retrieve its widgets information. This PIO was created by the company I work at, so I don't have any access to its code or information about it besides what is shown in the UI.  For example, one of the widgets is called "Address" that has a static text "T.0025.02". I need to save this static text into a variable to use it later on my code. As far as I understood, I need to use the function GetCustomObjectInfo(), but I couldn't understand how it works. Quote Link to comment
Pat Stanford Posted August 2, 2019 Share Posted August 2, 2019 GetCustomObjectInfo is used to get the handles you need to work from INSIDE the PIO. Since you are outside the PIO, you need to determine the Record.Field that contains the information you need and use that.  Check out this thread. It has a script that will create a worksheet showing all of the fields of a selected PIOs parameter records   Quote Link to comment
JBenghiat Posted August 2, 2019 Share Posted August 2, 2019 Use the plug-in manager to take a look at the data structure of the parameters (you can do this even if the plug-in is encrypted).  You will see two columns of labels. The second column is an optional display name — use the left-most column to confirm the name of the data field that you want.  When looking at Pat’s example and other examples, note that handling PIO data is identical to working with attached data records. Quote Link to comment
Tomas Posted August 5, 2019 Author Share Posted August 5, 2019 Thanks for the suggestions 🙂 . I noticed that in my example the type of the field was incorrect, it is actually just a text (not editable tho). But now that I have the data field name I need its value. Like in my exemple, save the text "T.0025.02" into a variable. I tried the code below but it returns me 0 rather then the text. Can someone help me save the inputs in variables?  hpio = vs.FSActLayer() hrecdef = vs.GetParametricRecord(hpio) recname = vs.GetName(hrecdef)  # Name of PIO in InfoPalette hrec = vs.GetObject(recname) fld = vs.GetFldName(hrec, 😎 RField = vs.GetRField(hrec, recname, fld) vs.AlrtDialog(RField) Quote Link to comment
Tomas Posted August 5, 2019 Author Share Posted August 5, 2019 Nevermind, I got the wrong handle in the function  RField = vs.GetRField(hpio, recname, fld)  Thank you for the support! 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.