Jump to content

Get PIO information


Recommended Posts

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.

Link to comment

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

 

 

Link to comment

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. 

Link to comment

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) 

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