Jump to content
Tomas

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.

Share this post


Link to post

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

 

 

Share this post


Link to post

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. 

Share this post


Link to post

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) 

Share this post


Link to post

Nevermind, I got the wrong handle in the function 

 

RField = vs.GetRField(hpio, recname, fld)

 

Thank you for the support!

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

 

7150 Riverwood Drive, Columbia, Maryland 21046, USA   |   Contact Us:   410-290-5114

 

© 2018 Vectorworks, Inc. All Rights Reserved. Vectorworks, Inc. is part of the Nemetschek Group.

√ó