DeSignature Posted March 24, 2020 Share Posted March 24, 2020 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. Quote Link to comment
Pat Stanford Posted March 24, 2020 Share Posted March 24, 2020 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. Quote Link to comment
DeSignature Posted March 25, 2020 Author Share Posted March 25, 2020 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. 1 Quote Link to comment
Pat Stanford Posted March 25, 2020 Share Posted March 25, 2020 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. Quote Link to comment
Recommended Posts
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.