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

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.


 

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.

×
×
  • Create New...