Jump to content

Ben624

Member
  • Content Count

    31
  • Joined

  • Last visited

Community Reputation

0 Neutral

About Ben624

  • Rank
    Greenhorn

Personal Information

  • Homepage
    www.benwilhelm.com
  1. I have written a control panel to move scenery around. By creating individual events for each button or field (rather than just the OK and CANCEL buttons) I have made it so that I can see my changes without hitting ok, but still hit cancel if I want. The problem now is that I have created a button that reads the values from all the sliders/fields/checkboxes and writes them to a text file to be recalled later. Unfortunately, because all of the actions are written into individual events, which are only triggered when a user clicks or edits its corresponding button or field, all my recall button does is put the values back into the fields without actually moving any of the scenery. As it is now, I would need to go through and click on each field to trigger its event in order to apply all the changes. I would like to write a function that cycles through each field and triggers its event to apply all the new values that were just recalled. Am I making sense? eg: so instead of my script looking like this: DialogEvent(item); CASE item OF kOK : BEGIN {-- GATHER ALL VALUES AND APPLY CHANGES --} END; It looks like this: CASE item OF kPiece1 : BEGIN {-- gather relevant info on piece 1 and apply changes to it, without closing the dialog --} END; kPiece2 : BEGIN {-- gather relevant info on piece 2 and apply changes to it, without closing the dialog --} END; etc. etc. The only way I can see right now is to copy all of my code under the OK event as well as under the individual events. argh.
  2. Hi all, Is there any way to force a dialog event without actually having the user click on a field or a button? Ben
  3. Is there any way to manipulate cameras in vectorscript? I'm currently just looking for a way to display the view of an existing camera, but I'm sure methods of greater control would come in handy somewhere down the road, too.
  4. You could give the text box a name (it's the first field under the 'Data' tab in the object info palette) and then get the handle using tbH := getObject('name') where tbH is your handle and name is the name you have assigned.
  5. I see. thank you both. I thought the VAR was required in the function definition. Thanks again! Ben
  6. Can anyone tell me why I can't pass a discrete value to a user-defined procedure or function? For instance, I have written the following function to set minimum and maximum allowable values in a dialog field: PROCEDURE LimitInput(VAR field : INTEGER; min, max : REAL); VAR fldInput : REAL; TxtOK : BOOLEAN; BEGIN TxtOK := GetEditInteger(dlogID,field,fldInput); IF fldInput > max THEN setEditInteger(dlogID,field,max); IF fldInput < min THEN setEditInteger(dlogID,field,min); END; Why can't I use this by specifying the min and max when I call the procedure? eg: LimitInput(kLED1, 0, 35). If I try this, the compiler tells me that I can only pass variables to the procedure, not discrete values. Is that really true? Do I need to declare variables strictly to pass values to my procedure? I can pass values directly to vectorScript's native functions and procedures. What makes mine different? Thanks! Ben
  7. Can anyone tell me if there is a way to put a button in a custom dialog that shows an image? I am trying to put view controls (right, left, top, iso, zoom, pan, etc) into a dialog, and I would like to put my own images on the buttons. Currently I'm using the CreateImageControl procedure to create the buttons. The controls show up and function properly in my dialog, but I can't get them to display an image. Can anyone help? Ben
  8. Ben624

    Layer Type

    worked like a charm. Thank you!
  9. Ben624

    Layer Type

    Is there any way for VS to differentiate between design layers and sheet layers? I want my script to cycle through all the design layers in a document, but not sheet layers. Ben
  10. That's how I started off, but I couldn't get the callback procedure that I used for ForEachObject() to talk to the list box that I created in the dialog.
  11. Figured it out. For some reason I have to write a nested WHILE/DO loop that looks through each layer seperately.
  12. Update: I am able to get the script to locate objects of other types. It will populate the listbox with names of symbols (T=15) and plugins (T=86). It still won't return anything for viewports (T=122).
  13. Alright, this is driving me crazy. I'm trying to write a script that creates a listbox with all of my viewports. Somehow in the execution of the WHILE/DO loop, my script can't find the viewports using the GetType() function. I've also tried using the Eval() function with no luck. I've tried isolating each part of the script, and everything works on its own. For instance, when I assign the viewport's handle explicitly according to the name of an existing VP, the script runs fine and it adds it to the listbox. Unfortunately, when I put it all together, it can't seem to find the viewports, or anything else for that matter. I've even tried changing the object type that it searches for, but it always comes up with nothing. I've run it in the Debugger and VPEval always evaluates to 0. Any thoughts? Here's the offending snippet /////////////////////////////////////////// CASE item OF SetupDialogC: BEGIN vpHand := FObject; WHILE vpHand <> NIL DO BEGIN VPeval := GetType(vpHand); IF (VPeval = 122) THEN BEGIN vpName := getName(vpHand); InsertChoice(11, 0, vpName); END; vpHand := NextObj(vpHand); END; END; ///////////////////////////////////////////////
  14. Does anyone know how to get rid of the rectangles that show up in a text field when you use the Tab key? This seems to be new to 12. I'm assuming it's a preference somewhere, but I can't find it. Ben
  15. Can someone tell me what the VWPluginLibraryRoutines files are all about? I have a feeling that there is some pretty useful stuff in there, but I'm not sure what it is or how to use it.

 

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