Jump to content

James Russell

Member
  • Posts

    394
  • Joined

  • Last visited

Everything posted by James Russell

  1. Michael, I saw your handiwork there so I can't take all the credit. Good team effort! The script's a function that I've been working on for a while; it's coming in handy. The INT(VALUE( )) I believe is going to cause us continual problems due to the fact that it's a function within a string dialogue. Cheers, J
  2. Michael, Have a look at the attached file and script for table generation. I originally thought a =1*, <>11*, <>111* would work but this morning a co-worker corrected me and we found that 1.*, 1 would be adequate. Check it out, I think it's pretty neat. J
  3. Michael, Indeed, this is a handy one to have up the sleeve but alas no victory on the database criterium. Hmmmmmmm..... J
  4. I'll attach an example document demonstrating my issue, cheers for the comment Michael. Just having trouble making that work in the DB lookup, it won't do it for me. J Ps. I hope this works with your Light Position Objs, mines modded, let me know if you need a reversion.
  5. Hey all, So I'm doing a count of my new lighting positions. The light position object script is locked which means upon creation the Name filed is text. In our office we're using this to label track with a numbering system. What would be ideal is to label them 7.01, 7.02, 8.01, 9.01. All well and good. The problem comes when I want to find all the objects on the track series 7. Which in this example is 7.01, and 7.02. This I believe could be a lookup of Field Value . Light Position Obj = 7* in the database lookup dialog. The issue arrises when you have track 77 or 700 or anything else. Is there a way in the database lookup I can convert this string to a val and round it perhaps, a Round(Str2Num('Light Position Obj'.'Name')-0.499) or something of equivalent? Let me know what you think. Cheers, J
  6. Francesco, After just getting my head around dialogs I can say it was an interesting experience. http://techboard.nemetschek.net/ubbthreads.php?ubb=showflat&Main=30918&Number=151961#Post151961 This is a topic which we only finished days ago. There are also plenty of resources to view under resources and examples at the Vectorworks homepage, have a look at these for various structures. As for what actually happens my comprehension is easiest understood in three parts. First is the layout section which deals with the physical layout of the dialog. The second is the handler which retains the data when the ok/cancel/anything button is pressed and then is used to save appropriate data to Variables, Strings and Booleans. The third is the run component which is what you will do with the newly saved components, make a table, make a rectangle, etc. If none of that makes sense feel free to chip in anyone. J
  7. So I've found that, =DATABASE('Lighting Device'.'Circuit'='R1/1') is not the same as =DATABASE(('Lighting Device'.'Circuit')='R1/1') My bad. But interesting to know if you don't want a field to refresh until interacted with. It's cool, J
  8. Hey all, Attempting to do a script loading a string into a database row. It's worked in the past perfectly but now there's an issue. The script runs fine, it loads the string into the row but it doesn't do the lookup. When you right click on the row in question and click Edit Criteria it brings up the lookup box with the correct criteria and when you click ok the row refreshes and looks up correctly. Here's the formula: Criteria:=concat('=DATABASE((''Lighting Device''.''Circuit'')=''',RDSTR,num2Str(0,RDVAL),'/',num2Str(0,STNUM+(INCVAL/2)),''')'); SetWSCellFormula(WSH,STNUM+INCVAL+2,0,STNUM+INCVAL+2,0,Criteria); I'm doing 50 different rows in this table and none of them are refreshing until I click on them and edit the criteria. Anyone encountered this before?? I'll post a youtube vid demonstrating if noone understands my description. Cheers, J
  9. Josh, Many thanks for your reply, after much trial and error and help from some great mates I've cracked open the beast that is the custom dialog. For anyone who's looking for it here is my test code. PROCEDURE RDT; VAR dialog1, result :INTEGER; STNUM, ENDNUM, RDVAL :REAL; RDSTR :STRING; success :BOOLEAN; WSH :HANDLE; {--------------------------Dialog Handler-------------------------------} PROCEDURE Dialog_Handler(VAR item :LONGINT; data :LONGINT); BEGIN Message('The item is',item); CASE item OF 1: BEGIN GetItemText(dialog1,4,RDSTR); success := GetEditReal(dialog1,5,2,RDVAL); success := GetEditReal(dialog1,7,2,STNUM); success := GetEditReal(dialog1,9,2,ENDNUM); END; END; END; {--------------------------Layout Creation------------------------------} BEGIN {//Create Dialog//} dialog1 := CreateLayout('Control Tables', FALSE, 'OK', 'Cancel'); {//Dialog Layout//} CreateStaticText(dialog1, 3, 'Control Equipment:', 25); SetFirstLayoutItem(dialog1, 3); CreateEditText(dialog1, 4, 'R/D', 6); SetBelowItem(dialog1,3,4,0,0); CreateEditReal(dialog1, 5, 1, 0, 6); SetRightItem(dialog1,4,5,3,0); CreateStaticText(dialog1, 6, 'Starting Number:', 25); SetBelowItem(dialog1,4,6,0,0); CreateEditReal(dialog1, 7, 1, 1, 6); SetBelowItem(dialog1,6,7,0,0); CreateStaticText(dialog1, 8, 'Ending Number:', 25); SetBelowItem(dialog1,7,8,0,0); CreateEditReal(dialog1, 9, 1, 12, 6); SetBelowItem(dialog1,8,9,0,0); IF VerifyLayout(dialog1) THEN BEGIN If RunLayoutDialog(dialog1, Dialog_Handler) = 1 THEN BEGIN WSH:=CreateWS(Concat(RDSTR,RDVAL,'- Control Table ',Date(2,1)),25,10); SetWSCellFormula(WSH,1,1,1,1,RDSTR); SetWSCellFormula(WSH,1,2,1,2,concat('=',num2Str(2,RDVAL))); SetWSCellFormula(WSH,1,3,1,3,concat('=',num2Str(2,STNUM))); SetWSCellFormula(WSH,1,4,1,4,concat('=',num2Str(2,ENDNUM))); END; END; END; RUN(RDT); Cheers, J
  10. Just incase anyone is still hanging around on this topic, I also encountered a similar problem with the label legends and ended up writing a script which detected the rotation of the fixture and applied a different label legend depending on the 0 to 180 or 0 to -180. If still required I'll dig it up. J
  11. Josh, Thanks for the links and showing your template. I've looked through the examples on custom dialogs, in particular the 'create light' example which deals with the custom dialog quite a lot. There seems to be a lot of GetControlData going on which after a lot of reading I don't quite get the context nor usage of in relation to the CreateLayout, saving data to a LONGINT, nor much else. Also don't yet understand the purpose of the DriveDialog in your example or Dialog_Handler in mine. What is the purpose of it within the structure of the code? Much appreciated, J
  12. Josh, I have no idea how close we must have been to posting next to each other because I didn't even see you when I replied. I think I'm doing ok on the creation front, I just need to extract my data now, how do I get my data back from this LONGINT goodness and put it into REAL vals and STRINGS and such? Thanks, J
  13. As an update I've made: PROCEDURE RDT; VAR dialog1 :INTEGER; result :INTEGER; PROCEDURE Dialog_Handler(VAR item :LONGINT; data :LONGINT); BEGIN END; BEGIN dialog1 := CreateLayout('Control Tables', FALSE, 'OK', 'Cancel'); CreateStaticText(dialog1, 3, 'Control Equipment:', 25); SetFirstLayoutItem(dialog1, 3); CreateEditText(dialog1, 4, 'R/D', 6); SetBelowItem(dialog1,3,4,0,0); CreateEditReal(dialog1, 5, 1, 0, 6); SetRightItem(dialog1,4,5,3,0); CreateStaticText(dialog1, 6, 'Starting Number:', 25); SetBelowItem(dialog1,4,6,0,0); CreateEditReal(dialog1, 7, 1, 1, 6); SetBelowItem(dialog1,6,7,0,0); CreateStaticText(dialog1, 8, 'Ending Number:', 25); SetBelowItem(dialog1,7,8,0,0); CreateEditReal(dialog1, 9, 1, 12, 6); SetBelowItem(dialog1,8,9,0,0); result := RunLayoutDialog(dialog1, Dialog_Handler); END; RUN(RDT); It looks all pretty and happy but how do I store the values into my variables that I want? Maybe this is more a question of getting values out of boxes Any insight much appreciated. J
  14. Hey all, I've been reading through several past topics on creating dialog boxes but have been able to find anything covering custom dialogs. I want to create a dialog that has 4 fields (see attached sketch), one of which is a Text input, CLETTER, the other three are numbers, CNUM, STNUM, ENDNUM. Reading through the VS guide relating to CreateLayout and a whole heaps of functions relating to that but I don't quite see how the structure works, nor how I can retain the values for later use. Would anyone be able to do a quick example or point me to a guide? Cheers, J
  15. Hey all, I've posted this question a little while ago but I now have a little more insight into the possibilities and reality of what is possible thus far. For the last few months I've been working on a complete template overhaul for our company. Attached is a screenshot of a lamp legend which after much work interlinking to the rest of the tables performs greatly. The images next to this are inserted manually, the now only manual task related to the entire titleblock, obviously we want to eliminate this problem. The images are part of the trademark look that we want to keep as we feel it provides the realistic on site install assistance which will help the job get done right. Before we've discussed inserting images into worksheet cells and that's a no-go, whether by script or formula. So now I have another path I wish to follow. Using scripting is it possible to identify either a particular cell's x:y coords in reference to a inserted WSImage (see second screen shot as an example) or to count a particular cell's position within a worksheet? If I could do this then I could probably identify what the cell contains and then locate a 2D symbol relative to the coords. Anyone follow or have input/ideas/solutions/problems? Cheers, James
  16. Wow, that's pretty cool! For all the visual learners out there, myself included, I'm more than a little bit interested. J
  17. Hey all, Anyone know of or have a library of scaff clamps? 90? and swivels for 48mm pipe would be great. Otherwise I'll just draw them... hehe. J
  18. Kevin, Thanks for asking them. I was hoping radiosity would have done the same process but alas no. I'm personally in no rush for this feature/capability (as nice as the idea is!). I was teaching textures to one of my students the other day and they were enquiring about light refraction through a glass of juice they had made, I was stumped and curious Cheers, J
  19. Wow, that first image is especially nice! It would be nice, maybe it's one more reason for an upgrade again, hehe. Thanks for the preview. J
  20. Hey all, Just experimenting with Vectorworks lighting functions. Has anyone been able to refract light using a prism object? I'm using a solid with the glass mirror renderworks texture applied at the moment and although the internals of my prism are as expected the resultant light seems unaffected. Is there a more advanced radiosity function I need to use or a refractal property I need to apply to my texture? Or does this functionality not exist? Cheers, J
  21. Stephen, I believe you can copy your custom workspace from Applications/Vectorworks 2010/Workspaces and place it in the corresponding VW2011 folder. Presumably there would be minor errors due to changes but they are the same file type and structure so I see no reason for it not to work. I only have the viewer for 2011 but I'd be interested to see. J
  22. Don't worry guys and girls, we'll be fine! It's just a little wet... it's still good... it's still good. Hehe
  23. Perhaps you've turned on a rendering mode, found in the view menu. Try Apple+Shift+W or view>rendering>wireframe and see if that helps. That's about the only time I ever see what you're describing. Hope that works. J
  24. Maarten, Your help has led to something so so helpful to me thankyou. For those of you who are interested in a finished product or for me reading this later when I can't remember what I did: Procedure Loop; Procedure RotTest(h : HANDLE); VAR rot :real; BEGIN rot:= GetSymRot(h); If GetRField(h,'Lighting Device','Device Type')='Light' THEN BEGIN If rot<=0 THEN BEGIN SetRField(h,'Lighting Device','Use Legend','Legend Rotated'); ResetObject(h); sysbeep; End ELSE BEGIN SetRField(h,'Lighting Device','Use Legend','Regular'); ResetObject(h); sysbeep; End; End; END; BEGIN ForEachObject(RotTest,(R IN ['Lighting Device'])); END; RUN (Loop); Mission success! Thanks all! J Ps. sysbeeps are just for fun!
  25. Thanks Benson and Michael, What you've described Michael is a handy layout and approach to viewport management. The feature that I was more looking for would be to merge or add to an existing viewport. I'll alter your list to try and make my idea clearer. 1. Double click on the viewport tab in the navigation palette 2. Click the visibilities button in the top right 3. In the left column select a viewport or saved view 4. Click copy visibilities 5. In the left column select all or a range of viewports 6. Click merge visibilities and have a dialogue which asks if you want to add only, overwrite conflicting values, or solve conflicting errors. 7. Click OK That's kinda my thoughts. J
×
×
  • Create New...