Jump to content
DeSignature

Edit item in several PIO's via widget button

Recommended Posts

I realized I should start a new topic since the problem in the previous topic Select PIO's on Sheet Layers has been solved, so:

 

Quote

Well, here's my cry.

As suggested I'm trying out the ForEachObjectInLayer procedure.

The function in the procedure is able to select every PIO on every layer (no matter the layer type, for now), it is able to edit the text in the PIO on the current layer, but it doesn't edit the text in the PIO's on the other layers.

 

As I (kind of) mentioned before:

A widget button in the PIO creates a custom dialog box, there's an EditText-field in that dialog box that edits a record field and the record field edits the text that is created in the PIO.

Since the function can select the PIO on all layers, how come it doesn't edit the text on ALL layers?

Could it be because of the widget button or the custom dialog?

I use a checkbox in the dialog box to edit the text (IF BooleanItem returns TRUE then ForEachObjectInLayer (FUNCTION, 0, 2, 1)),

but since I only push the widget button and since I only check the checkbox in the PIO on the current layer, the widget buttons and the checkboxes in the dialog boxes in the PIO's on the other layers don't get pushed and don't checked.
I've tried the SetBooleanItem (DialogID, ..., TRUE) in the function, but that doesn't suffice to do the trick.

 

Share this post


Link to post

Since the widget is part of the PIO code, it is not universal and editing it will only effect the current instance of the PIO. You can edit he PIO code to edit other selected objects also, but you are not going to get the general multiple object editing that you would in changing a general parameter of layer or class or parameters like the size of a rectangle.

 

Your PIO code would need to find the other PIOs and use SetRField to change the parameters to match the changes in your widget.

 

 

Share this post


Link to post

ForEachObject (CallbackProcedure, PON = PIO_Name) does the trick.

Apparently it was kind of important to call the ResetObject procedure in the CallbackProcedure, the fields in the dialog box were edited correctly but the text objects in the PIO didn't get edited without a ResetObject procedure.

  • Like 1

Share this post


Link to post

Glad you got it worked out.  Yes, if you change objects programmatically you definitely need to tell them to reset or they will retain the old image.

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