Jump to content
Nik

Pull information from a selected object into a PIO on creation

Recommended Posts

Here's what I'm trying to do:

 

User selects an object

User then selects the PIO tool and inserts the PIO

PIO uses info from the selected object as a parameter value.

 

Currently:

I get the handle to the user selected object using LSActLayer or FSActLayer. 

Use GetRField to extract the information from the object.

Run GetCustomObjectInfo to get the PIO handle

Write the information to the PIO using SetRField 

 

The problem I'm having is that it appears that a PIO resets(vsoGetEventInfo #3)  itself 3 times before the creation is finished. On the first reset event the handle still points at the user selected object, on the second reset event the handle is empty, on the third reset the handle points to the new PIO

 

Short of writing the information to a file how do I get the information from a user selected object into a PIO on creation?

Share this post


Link to post

Ideally, you would control the exchange of data outside the PIO:

 

Custom menu command:

Require a selected object. Extract data from the selected object. Ask user to click a point, then insert the PIO and set its fields. RunTempTool can be useful here.

 

Custom tool:

Click in the drawing for the insertion point. Insert the PIO. Ask the user to select an object. TrackObject can be useful here.

Note, the tool code does not run until after your first click, so doing the above in the revers order would be difficult.

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.

×