Jump to content


  • Posts

  • Joined

  • Last visited


1 Neutral

Personal Information

  • Location

Recent Profile Visitors

854 profile views
  1. Following your remarks, I have deleted the LinkText() calls, I tried to include the GetObject function in about every part of the script, I tried to include the DefineCustomObj function in about every part of the script - every part but the correct one, I guess - using the 3 possible preference settings, I did not delete or replace the GetRField function since I do use the SetRField function in the script. but still, in every case the texts do not get displayed at insertion of the PIO. As far as I can understand, I have to try to create the records before anything else happens in the script, so I guess I I'm creating the records at the wrong time in the script. As I have mentioned above, the DefineCustomObj function did not help out on this one, where should I call this function?
  2. It's just that GetObject(plug-in_name) contained 'plug-in_name' and not 'plug-in_handle', but I really do agree it would have been much wiser to check the function reference before putting out my opinion and I will keep your advise in mind. Hoping I didn't offend anybody in any way, Dimitri.
  3. Well I'll definitely will have to give that a try, but something tells me that this function will look for inserted PIO's and not for (hidden) PIO records ... Anyway, I have simplified the actual code and tested the result, the result is the same, the variable strings are not being displayed at the moment of insertion, they get displayed when the 'Edit Subgeometry' dialog gets confirmed or when the PIO is being reinserted. Really looking forward to your findings, just hoping it won't be something too obvious ... Dimitri. PROCEDURE Simple; VAR PIO_N : STRING; PIO_H, PIO_R, PIO_W : HANDLE; EventId, EventResult : LONGINT; DialogId, DialogResult : LONGINT; Result : BOOLEAN; Txt : STRING; PROCEDURE Geometry; PROCEDURE Define_Size; BEGIN END; PROCEDURE Draw_Geometry; BEGIN; RectangleN (-30, -15, 1, 0, 60, 30); END; PROCEDURE Insert_Subgeometry; PROCEDURE Draw_Subgeometry; BEGIN MoveTo (-30, 10); LineTo (60, #0); MoveTo (0, -15); LineTo (30, #90); END; PROCEDURE Insert_Text_Items; PROCEDURE Insert_Text_Items_A (x, y: REAL; T: STRING); BEGIN TextSize (8); MoveTo (x, y); CreateText (T); END; PROCEDURE Insert_Text_Items_B (x, y, StrS: REAL; T: STRING); BEGIN TextSize (StrS); MoveTo (x, y); CreateText (T); END; BEGIN Insert_Text_Items_A (-15, 12.5, 'Text A:'); Insert_Text_Items_A (15, 12.5, 'Text B:'); { ... } Insert_Text_Items_B (-15, 0, 12, GetRField (PIO_H, PIO_N, 'RecordField A')); LinkText (LNewObj, PIO_N, GetRField (PIO_H, PIO_N, 'RecordField A')); Insert_Text_Items_B (15, 0, 12, GetRField (PIO_H, PIO_N, 'RecordField B')); LinkText (LNewObj, PIO_N, GetRField (PIO_H, PIO_N, 'RecordField B')); { ... } END; BEGIN Draw_Subgeometry; Insert_Text_Items; END; BEGIN Define_Size; Draw_Geometry; Insert_Subgeometry; END; PROCEDURE EditSubgeometry; PROCEDURE Records; BEGIN NewField (PIO_N, 'RecordField A', 'TEXT A', 4, 1); NewField (PIO_N, 'RecordField B', 'TEXT B', 4, 1); { ... } END; PROCEDURE Apply2All (ObjH: HANDLE); BEGIN GetItemText (DialogID, 161, Txt); SetRField (ObjH, PIO_N, 'RecordField A', Txt); { ... } ResetObject (ObjH); END; PROCEDURE DialogLayout; BEGIN DialogId := CreateLayout ('Dialog A', FALSE, 'OK', 'Cancel'); CreateGroupBox (DialogId, 100, 'Tab A', FALSE); CreateRightStaticText (DialogId, 110, 'Text A:', 20); CreateEditText (DialogId, 111, 'TEXT A', 41); { ... } CreateCheckBox (DialogId, 120, 'Apply To All'); SetFirstGroupItem (DialogId, 100, 110); SetRightItem (DialogId, 110, 111, 0, 0); SetBelowItem (DialogId, 110, 120, 0, 0); { ... } CreateGroupBox (DialogId, 200, 'Tab B', FALSE); CreateRightStaticText (DialogId, 210, 'Text B:', 20); CreateEditText (DialogId, 211, 'Text B', 41); { ... } SetFirstGroupItem (DialogId, 200, 210); SetRightItem (DialogId, 210, 211, 0, 0); { ... } CreateTabControl (DialogId, 10); SetFirstLayoutItem (DialogId, 10); CreateTabPane (DialogId, 10, 100); CreateTabPane (DialogId, 10, 200); END; PROCEDURE DialogEvents (VAR Item, Data: LONGINT); PROCEDURE DialogSettings; BEGIN SetItemText (DialogID, 111, GetRField (PIO_H, PIO_N, 'RecordField A')); { ... } SetItemText (DialogID, 211, GetRField (PIO_H, PIO_N, 'RecordField B')); { ... } END; PROCEDURE ConfirmDialog; BEGIN GetItemText (DialogId, 111, Txt); SetRField (PIO_H, PIO_N, 'RecordField A', Txt); { ... } GetItemText (DialogId, 211, Txt); SetRField (PIO_H, PIO_N, 'RecordField B', Txt); { ... } GetBooleanItem (DialogID, 120, Result); IF Result = TRUE THEN ForEachObject (Apply2All, PON = PIO_N); ResetObject (PIO_H); END; PROCEDURE CancelDialog; BEGIN END; BEGIN IF GetCustomObjectInfo (PIO_N, PIO_H, PIO_R, PIO_W) THEN CASE Item OF SetupDialogC : DialogSettings; 1 : ConfirmDialog; 2 : CancelDialog; END; END; BEGIN Records; DialogLayout; IF VerifyLayout (DialogID) THEN DialogResult := RunLayoutDialog (DialogID, DialogEvents); END; PROCEDURE Button_B; BEGIN END; PROCEDURE Button_C; BEGIN END; PROCEDURE Button_D; BEGIN END; PROCEDURE AutoEdit; VAR AutoTxt : STRING; BEGIN AutoTxt := GetFName; IF GetCustomObjectInfo (PIO_N, PIO_H, PIO_R, PIO_W) THEN BEGIN SetRField (PIO_H, PIO_N, 'RecordField A', AutoTxt); { ... } END; ResetObject (PIO_H); END; BEGIN vsoGetEventInfo (EventId, EventResult); CASE EventId OF 03: IF GetCustomObjectInfo (PIO_N, PIO_H, PIO_R, PIO_W) THEN BEGIN PushAttrs; Geometry; PopAttrs; END; 05: BEGIN Result := SetObjPropVS (08, TRUE); Result := vsoInsertAllParams; Result := vsoAppendWidget (12, 100, 'Edit Subgeometry', 0); Result := vsoAppendWidget (12, 200, 'Button B', 0); Result := vsoAppendWidget (12, 300, 'Button C', 0); Result := vsoAppendWidget (12, 400, 'Button D', 0); Result := vsoAppendWidget (12, 500, 'Auto Edit', 0); END; 35: IF GetCustomObjectInfo (PIO_N, PIO_H, PIO_R, PIO_W) THEN CASE EventResult OF 100: EditSubgeometry; 200: Button_B; 300: Button_C; 400: Button_D; 500: AutoEdit; END; END; END; RUN (Simple);
  4. The function Count (R IN [PIO_N]) helped me out here, but I could not find a the criteria to see if a record already exists in a drawing. Since the function above checks if there exists an object with the referenced record attached to it in the drawing, it still doesn't check if a certain record exists in the drawing. If I insert the PIO in a drawing for the first time the Count will return 0, once I've inserted 1 PIO, the count will return 1, but if I delete the PIO the count would return 0 again - which would be correct, but the PIO did create a record and if I delete the PIO, the record would still exist in the drawing. EDIT: This function only helped me out to display the text objects at the insertion of the PIO, since the created texts were constant strings ('Some Text'), they couldn't be edited anymore, so ...: back to the drawing board.
  5. Is there a function or a procedure that can check whether or not a record already exists in a drawing? Apparently, if I replace the variable strings ( GetRField (PIO_H, PIO_R, StrVar) ) in the linked text items by constant strings ( 'Some Text' ), then the text items get displayed at the first insertion of the PIO. So, I guess I could write a code that checks if the record is already present in the current drawing, if not then the text items should use constant strings, if so then the text items should use variable strings.
  6. The PIO is not being placed via a script, I just click a button in a tool palette and place the corresponding (custom) object somewhere on a sheet layer. For now, I'll check out the DefineCustomObj function. Thanks.
  7. How come, if I call my PIO a first time in a drawing that all PIO record fields - since all the respective text items that are created in that PIO are blanc - appear to be empty? If I delete that PIO en recall the same PIO, all the text items are displayed as I intended them to be displayed. When I insert the PIO in a new drawing, there is no PIO record in the new drawing, I guess when I reinsert the PIO, the PIO can get it's values from the record created by the first call. Is there a standard procedure to avoid this behavior?
  8. 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.
  9. 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:
  10. I have moved my cry for help to a new topic 'Edit item in several PIO's via widget button' since the original problem has been solved.
  11. Thanks Pat, I'll give it a few tries, and I will cry out for help if get too desperate. Dimitri.
  12. Thanks Julian, This works perfect to select the PIO - as I asked in my post - and I hoped this answer would solve my problem. Actually I'm trying to use something like the title block feature "apply to all title blocks" (loosely translated). In my PIO I've managed to create a text that is linked to a RField, a custom dialog sets the RField and edits the text on a sheet layer. The suggested criteria can select the PIO, but it doesn't help to edit the text on all the sheet layers, I guess I will have to revise the procedure I've used in ForEachObject(Procedure, Criteria). Are there any other criteria that refer to sheet layers, I know GetObjectVariableInt (ObjHandle, 154) should return '2' for sheet layers, but this knowledge doesn't seem to help out here, I can't use it to set the criteria. Thanks again, Dimitri.
  13. Hi, Could anybody help me out with the criteria to select a PIO on every Sheet Layer? Thanks.
  14. We usualy get by with about 6 relevant hatches, so it seems doable to me, especially if we would restrict the number of hatches in the dialog to about twelve items [1..12]. Wouldn't be bad for the drawing hygiene as well... What would be the easiest way to differentiate between the different hatches. I guess I would have to script something like the code mentioned above, but I noticed it is will not be as easy as that. Any basic suggestions about how to aproach this dialog? or how to approach a dialog with n-number of items?
  15. Hi, I'm trying to display a legend, but I would like to be able to select the specific hatches to be displayed. Since I don't know how many hatches are used in a drawing, would it be possible to build a dialog according to the - schematic - code below? HatchId := BuildResourceList (66, 14, 'Hulpbronnen - Lijnarceringen', HatchNum); FOR n := 1 TO HatchNum DO CreateCheckBox (DialogId, Item(n), Index2Name(Item(n))); SetFirstLayoutItem (DialogId, Item(n)); SetBelowItem (DialogId, Item(n), Item(n) + 1, 0, 0);
  • Create New...