Jump to content

Ben624

Member
  • Posts

    31
  • Joined

  • Last visited

Everything posted by Ben624

  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.
  16. Any plans to give vectorworks the ability to slave other computers on a network for rendering tasks?
  17. I am using the 'putFile' command to save a text file which I later use to recall scenic configurations in my drawing. Is it possible to save my text file using an extension other than '.txt'? Thanks!
  18. I have had the same problem. I can't see any reason why one should work and another shouldn't, but sure enough... Can anyone help?
  19. 2 Questions: 1. I have attempted to combine two fairly large scripts (800+ lines) into one. I've discovered that when the new script reaches a certain size, everything after approximately line 1200 will disappear when I re-open the script for editing. Is there a size limit to scripts or is this some sort of bug? 2. We have a six-seat license for Vectorworks. Is there a way that I can put PIOs on our network after I edit them, rather than having to drop them individually into each machine's Plugin folder?
  20. Is there a way to reference the last instance of a PIO from its own script? I'm trying to create a tool that will essentially number itself as I use it repeatedly. So when I use this tool (the 'Channel Indicator'), it will check the value of the channel parameter for the last instance that I created and increase it by one for the currently executing instance. Does that make sense? Ben
  21. "In my experience the backlit materials never have the punch they would have in real life." One little cheat that I have discovered (I run 11 at work, so I don't know if it still works in 12) is that you can give lights intensities greater than 100. This doesn't seem to add to the rendering time the way it would if you were to add multiple lights.
  22. I am updating a model that someone else created. In it, there are a number of translucent, backlit panels that had a texture with constant reflectivity applied to them. I have converted those surfaces to nurbs, applied an actual translucent texture to them and backlit them. Unfortunately this has required me to add approximately 300 light sources. The rendering time has made the model nearly useless. I tried saving a new copy, deleting all the new light sources, and applying a constant texture to the surfaces, but that did not make it render any faster. Is it the NURBS surfaces that are making this take so long? I tried using custom renderworks and unchecking the "use NURBs" box, but that didn't help much. Why would it take so long to render even after I have deleted all the extra light sources? Does anyone have any general pointers for keeping rendering times down? Thanks, Ben
  23. That's what I was afraid of. Thanks very to both of you for your help. Perhaps in Spotlight 12 gobo projectors will be able to store a separate beam angle? Ben
  24. "Ok. So if you run the script as written this works: GetWSCellValue(theWS,i,4,intensity); SetObjectVariableReal(light,51,intensity/100) And this doesn't: GetWSCellValue(theWS,i,6,beam); SetBeamAngle(light,beam/2); And if you remove reset they both work?" Correct. Everything that refers directly to the light works properly as long as I don't reset the gobo projector. Unfortunately, I need to reset the gobo projector to get the color change to apply. When I reset the gobo projector, the light's beam angle and the spread angle are both reset to the gobo projecter's field angle parameter. SetObjectVariableReal(light,62,beam/2) did not fix problem.
×
×
  • Create New...