Jump to content

SamIWas

Member
  • Posts

    409
  • Joined

  • Last visited

Everything posted by SamIWas

  1. I learned Vectorscript by starting with very simple scripts I could find online and parsing what each line meant. I also used the Function Reference, which has plenty of examples, and later the Language Guide, which also has a lot of examples. I would try a new function every time I wrote a script and see how it worked. And, I would ask questions on this forum. I now write script consistently. The only thing that pisses me off is the years-long bug that arbitrarily limits the number of scripts you can have in the object context menu...a lot of them simply will not run. That alone has made me question upgrading further.
  2. Amongst others, I have a power service and phase field in my Lighting Device records. Once I assign the correct info to each fixture, I can get a report of how much is used on each service and phase. All my data imports into filmmaker, where I use a custom database with scripts which can auto-generate phases for any given rack when given a circuit number. This then gives a detailed report of power usage.
  3. Oh....I should say I also asked a lot of questions here and got some very helpful advice.
  4. I agree with both of these. Any question I ask on this forum, I almost always get someone trying to help, even if it takes multiple posts to do so. And in the case of my question about Vectorscript Custom Dialogs, it opened up a whole new level of possibilities that I've been wanting to learn for years. Also, this forum has active participation from the developer, and they seem to actively look at troubleshooting and bug submissions. You can't beat that. Contrast this to the forum for another piece of software I use where I have been told on many occasions that I need to not ask questions, but rather go and learn. IN fact, the answer to one question on how to best accomplish a complex scripting action, I was told "Think about what you want to do, and then go figure out how to do it". Not very helpful at all. And the developer does not seem to respond to anything on the forum.
  5. I second Pat's advice. I'm not nearly as advanced as others, but I can write a mean script. I learned it all from starting with something very simple, looking at other scripts and parsing how they worked, and spending a LOT of time looking at the function reference document. The function reference document has examples for many of the functions, and that will give you ideas as you go.
  6. Agreed. This made me remember my opposite experiences from the support forum for another piece of software I use a lot. One time, I posted asking about how to achieve a certain result by combining some records in a database, and the response I got from multiple people was "Why don't you think about what you want to do and then figure out a way to achieve that". Super helpful.
  7. Thank you! Don't know how i didn't see that thread. It does indeed seem to be a permissions issue, and you have to set them on every folder within Libraries in the application folder.
  8. Also, if I go to the "Download Content" menu, it will download, then pop up an error saying "Attempted to install three times and failed" or something like that.
  9. Every time I start Vectorworks, it tells me I have libraries that are available for download/updating. Yet, every time I tell them to update, I get an error message saying that I can't. I have a feeling this is related to the fact that when I first tried to download the libraries, I was on the slow internet at work, and had to cut it off. Any idea how to rectify this? Do I just need to hunt down the existing libraries and delete them, then start over?
  10. This is all great info. I've been using it over the past week to update a bunch of scripts. Now, if they'd just fix the workplace limits after years of annoyance!
  11. Someone else might correct me, but I'm pretty sure you need to create a separate label legend for this. This would be for several reasons. Mostly, when you flip a fixture and the legend has two fields which combine, such as circuit name and number, then those would reverse upon a flip.
  12. Thanks, Pat...was able to get ForEachObject to do what I needed!
  13. Was wondering about ForEachObject, but since the function reference guide states that it's essentially the same as writing a NextSObj loop, I thought it might not work. But I guess I will go test more of that.
  14. I've always used h:=NextSObj or h:=NextObj in loops to run a script across a series of items. While updating my scripts, I'm trying to get them to work across layers if layers are set to Show/Snap/Modify. Selection works across the layers, reporting the number of selected items world across layers, but NextObj and NextSObj do not. Is there another procedure I should be using?
  15. I've posted about this a few times over the past few years, but this has been going on for more years than that. I think 2014 was the first time I noticed these issues. I like to write a lot of shortcut scripts to greatly speed up my workflow. It used to work very well for me. But, at some point, it just randomly stopped working. I was hoping that 2017, and starting fresh without importing any settings or plugins (re-writing all of them) would see the issue solved. But alas, we're back at square one. Tonight, I created my second menu under the "Object Context" menu, and dropped two known-working scripts into it. They did not function. Moved them to another location, and they ran fine. I remember JimW responding to this issue, but can't seem to find it. I would really like to know what the limitations of the workspace menus are so that I can craft my workspace to work the best for me, and not just hope that any given menu will work any given day. This has been killing me for four years now. Is there any chance of it getting fixed or is it time to just give up on heavy customization?
  16. It seems to be working for me. I've never used this feature, but if I select a file in the finder and press the spacebar, I get some semblance of a preview. It appears to be whatever the view was the last time the file was closed.
  17. Thanks! Nice info! Finished off my first one last night and it works perfectly. Now to start re-writing all my scripts for 2017.
  18. Holy crap. That did it. I would have never figured that out. Didn't realize you had to declare VAR again for each new type. Weird that the compiler doesn't catch that. Thank you so much everyone! I think I have the basics down and can get started making some new dialogs!
  19. Okay...I'm 95% comfortable with what's going on now. I've got variables passing between the main part and the dialog handler, and reporting at the end. The only exception is the text field, ID 6 (it's a text field just for testing purposes). It doesn't pass to the message at the end. Everything else works as intended, and I think I have the dialog handler written more correctly. So, if you can point me where I'm going wrong on the text field, I will owe you my eternal gratitude, and hopefully put this thread to a close! Procedure AssignInfo; var gValue,gAddr: integer; gUniv:STRING; function Mydialog(var lValue,lAddr:integer;lUniv:STRING):boolean; VAR id :INTEGER; result :INTEGER; PROCEDURE Dialog_Handler(VAR item :LONGINT; data :LONGINT); var Bool: boolean; tUniv:String; tAddr:integer; BEGIN CASE item OF SetupDialogC: BEGIN SetItemText(id,6,'0'); SetEditInteger(id,7,0); SetBooleanItem(id,8,TRUE); END; 1: BEGIN GetItemText(id,6,lUniv); If GetEditInteger(id,7,TAddr) then lAddr:=TAddr; GetBooleanItem(id, 8, Bool); if Bool THEN lValue := 1; END; 2: BEGIN END; END; {case} END; {Dialog Handler} BEGIN id:=CreateLayout('Assign Address',TRUE,'Apply','Cancel'); CreateStaticText(id,4,'Assign Universe:',-1); CreateStaticText(id,5,'Assign Address:',-1); CreateEditText(id,6,'0',6); CreateEditInteger(id,7,0,6); CreateCheckBox(id,8,'Use three digits for address'); SetFirstLayoutItem(id,4); SetRightItem(id,4,6,0,0); SetBelowItem(id,4,5,0,0); SetRightItem(id,5,7,0,0); SetBelowItem(id,5,8,0,0); SetHelpText(id,6,'Enter Universe'); SetHelpText(id,7,'Enter DMX Address '); SetHelpText(id,8,'Convert DMX address to 3 digits. Example: 45 = 045'); result := RunLayoutDialog(id, Dialog_Handler); if result = 2 then Mydialog := false else Mydialog := true; END; {Mydialog} begin {main} if Mydialog(gValue,gAddr,gUniv) then begin message('Universe is ',gUniv,' / Address is ',gAddr,' / Checkbox value is ',gValue); end; end; {main} run(AssignInfo);
  20. Thanks for the info Josh...I'll keep plugging along using your help above. I knew it probably wasn't the best example, but simpler examples have been hard to find. And what you see above is after I cleaned up the spacing, tabs, and lines! Not really new to programming. I've written over 100 VectorScripts so far to do all sorts of things, including my own custom GrandMA exporter (because I don't like the official one). So far, I've used the standard built-in dialogs. There's just something about the way this custom dialog thing works that isn't connecting in my brain. Seems like it could be so much simpler!
  21. I've been experimenting some more, and decided that the examples I was working with were too complicated to learn from. So I found a much simpler one, but still have a question or two... ------------------------------------------------------------- Procedure test; var gValue : integer; function Mydialog(var lValue:integer):boolean; VAR id :INTEGER; result :INTEGER; PROCEDURE Dialog_Handler(VAR item :LONGINT; data :LONGINT); var Bool: boolean; BEGIN GetBooleanItem(id, 5, Bool); if Bool THEN lValue := 0; GetBooleanItem(id, 6, Bool); if Bool THEN lValue := 2; GetBooleanItem(id, 7, Bool); if Bool THEN lValue := -1; END; BEGIN id := CreateLayout('Set Visibility', FALSE, 'OK', 'Cancel'); CreateGroupBox(id,4,'Visibility:',true); CreateRadioButton(id,5,'Show'); CreateRadioButton(id,6,'Grey'); CreateRadioButton(id,7,'Hide'); SetFirstLayoutItem(id,4); SetFirstGroupItem(id,4,5); SetBelowItem(id,5,6,0,0); SetBelowItem(id,6,7,0,0); result := RunLayoutDialog(id, Dialog_Handler); if result = 2 then Mydialog := false else Mydialog := true; END; {Mydialog} begin {main} if Mydialog(gValue) then begin message(concat(gValue)); end; end; {main} run(test); ------------------------------------------------------------- So, the part that is blue is a no-brianer. Not worried about that at all. I'll start with questions... gValue is specified as a variable for procedure "test" as an integer. But, nowhere in the script is gValue given a value. During a function, a value is given to variable lValue. But at the end of the script, a message displays gValue with the value given to lValue. Where is gValue being given its value from lValue? In Procedure Dialog_Handler, I know i can add in GetItemText calls to retrieve strings from CreateEditText boxes and GetEditInteger/Real calls to retrieve numbers from CreateEditInteger/Real boxes in the layout. I assume that I need extra variables of String, Integer, and Real types to collect the info. So, let's say I do the following (changes in red) function Mydialog(var lValue:integer;univ:string):boolean; VAR id :INTEGER; result :INTEGER; PROCEDURE Dialog_Handler(VAR item :LONGINT; data :LONGINT); var Bool: boolean; BEGIN GetItemText(id, 8, univ); GetBooleanItem(id, 5, Bool); if Bool THEN lValue := 0; GetBooleanItem(id, 6, Bool); if Bool THEN lValue := 2; GetBooleanItem(id, 7, Bool); if Bool THEN lValue := -1; END; How does univ get passed down? Did I even put univ in the right place? At some point, something is going to click, and I'll be able to fully grasp what is going on start writing more complex dialogs.
  22. Do you mean so that they don't move when you plug in and unplug from your system? They always move when I disconnect and reconnect my laptop. It sucks.
  23. Thanks for the info, guys! Had a busy day today, but will look more into it tomorrow when I might have a fresh brain.
  24. I know I've asked about it before, but now we have an official wishlist and voting system. I'd like to see the keyboard shortcut system completely redone. As it stands almost every combination of keys is used by VW already. And what remains uses three modifier keys for the most part. This makes it difficult for those who write a lot of shortcut scripts and would like to have keyboard shortcuts for them, especially to map to external shortcut systems. It also makes them hard to remember when your channel assign script is command-option-control-w or something, since that letter has no relation to channel. In my opinion, Cinema 4D has the best shortcut system. In addition to normal modifiers, you can have two-key combinations, almost like category shortcuts. So, say I was assigning Lighting Device parameters, I could press L then C, and that would run my "Assign Channel" script. L-D would run my "Assign Dimmer" script. L-P for "Purpose". Cable Tools could have a category. Walls could have a category. Instead of the current 150 or so possibilities, it opens up hundreds more possibilities. I guess I could see how it might be daunting, or that a script could ruin your day by accidental typing, but I'd still love something to be done.
×
×
  • Create New...