Jump to content

WhoCanDo

Member
  • Posts

    402
  • Joined

  • Last visited

Everything posted by WhoCanDo

  1. I'm probably behind the times here but I have never used $Include until this instance when my script got too large and it was suggested as a solution. Normally I write the macro scripts, not as plugins, and lock them within the stationary sheet so that the drawing is a single entity and is transportable throughout the office and to other sites. In this case the text files are on our server and accessible by the vectorscript localy. They can't be locked and if I send my stationary to our out-of-country site then they have to have the same $Include path for the macro to work. Do you have an alternative setup suggestion?
  2. There is definitely a limit related to 32bit. I finished my script using $Includes but I'm not happy because I can't make the $Include files secure and sharing the $Include files across the networks and also making them transportable is a nightmare. When I add all the code to the internal script editor and then "OK", I get the message "The Script contains 79670 characters. 47669 of which will be lost. Do you wish to continue? The Script Editor can not save a Script with more that 32001 characters. etc." I would have thought that VW would be 64bit by now.
  3. Yes, I can see your reasoning. CreateExtrudeAlongPath seems to take my donut profile and extrudes along the path without a hole. ExtrudeAlongPath doesn't seem to work at all. However, I couldn't get CreateCustomObjectPath to work either until you offered a solution.
  4. Thanks Mate, Why do they make it so difficult when DoMenuTextByName ('Extrude Along Path', 0); would have done. Regards
  5. I want to create a pipe using Extrude Along Path as I can with the option from the "Model" menu but after trying several variations I can't get the Extrusion working. Any ideas anyone? After running the following macro I can use the "Model/Extrude Along Path" manually and it creates exactly what I want but I can't find a procedure that works in the macro... procedure Pipe; var h1, h2 : handle; PipeOD, Wall, p1X, p1Y, p1Z, p2X, p2Y, p2Z : real; begin PipeOD := 42.4; Wall := 3.2; Message ('Pick first and last points.'); GetLine3D (p1X, p1Y, p1Z, p2X, p2Y, p2Z, false); Poly3D (p1X, p1Y, p1Z, p2X, p2Y, p2Z); h1 := ConvertToNurbs (LNewObj, false); Oval (-PipeOD/2, PipeOD/2, PipeOD/2, -PipeOD/2); Oval (-PipeOD/2 + Wall, PipeOD/2 - Wall, PipeOD/2 - Wall, -PipeOD/2 + Wall); h2 := LNewObj; ClipSurface (PrevObj (h2), h2); DelObject (h2); { h2 := CreateCustomObjectPath ('Extrude Along Path', h1, LNewObj); } ClrMessage; end; run (Pipe);
  6. OK. Got it... procedure this; var {$Include filename_with_path} begin end; run (this); and then use Notepad or other text editor to edit the filename. Thanks
  7. Just a little more help please. Is this all I put in the script editor? {$Include WonderScript.px} or is it procudure ...; {$Include WonderScript.px} begin end; run (...); or what? Thanks
  8. I've nearly finished writing a macro and now VW tells me I've exceeded my 32000 character length. I'm using VW2014 and I will upgrade to VW2015 64bit if someone can confirm that the 64bit version will allow me to exceed the 32000 character length. If not then does anyone have any tricks to overcome the 32000 character limit? Does this limit include just spaces or can I change some leading format spaces to tabs etc.?
  9. Thanks Guys, lots of good ideas. Hipppothamus - even if I ignore groups, the lines within the groups aren't ignored by VW because they are selected. Miguel - that's a good idea until I have many many lines then the task is too taxing. Pat - thanks that worked a treat.
  10. I want to place text next to each of the lines I have selected to indicate their lengths on my drawing. That's the easy part - done! The problem is that within a group, lines are also selected. When we create a groups we select the items and group them and then deselect the group but the items within the group remain selected. If the lines within the group remain selected then, even though I have not selected the group, these lines also have their lengths placed along side. How can I deselect all objects other than my chosen selected lines? DSelectObj (InObject); doesn't work.
  11. Use to be able to move the radius or diameter text along the radius or diameter line but now we can't. Please bring this feature back since we can move any other dimension text where we like it. Regards
  12. Thanks Ben, There are not enough spaces in the prefix field to move it as far as I want too but the second idea may work. Anyone else with some ideas? I think I will add this to the wish list since I don't know why this is not a common problem for many people. Regards
  13. In VW12 (I think) we use to be able to move the text on a radius dimension but now we can't (currently VW2014). Can anyone tell me if they know of a way to move the text along the radius line since my center-line is not in the printing area and I still want to reference it by just shifting the text onto the page?
  14. Running the following will always produce the list in order from bottom to top. SetName will rename the handle and may be what your looking for. procedure L; var h : handle; i, LC : integer; begin h := FLayer; LC := NumLayers; for i := 1 to LC do begin message (LC, ' ',i, ' ', GetLName (h)); wait (2); h := NextLayer (h); end; end; run (L);
  15. Totally agree + even on my 1920 x 1080 screen resolution I can't see the difference in the icons make a choice. I have re-named them but that's not the point. I could see them in VW2012
  16. Unless someone has a better idea I want to write a macro for two reasons: 1. If I use the ordinate dimension to dimension a piece of material and I have forgotten a point then I have to re-select the zero point and add the new point, then go back and delete the second zero point/dimension. 2. If my ordinate dimension needs to start at 500000 then I want to choose this point first and then continue. My first click won't be 0 but will be 500000. Any ideas?
  17. What function can I use to select the dimension ordinate mode tool in vs macro? Regards
  18. When changing the layer scale there is the option of "Scale Text" under the "Paper Scale" title. The following macro asks the user what layer scale they would like and changes all layers with a scale the same as the active layer to the new scale. How can I modify this to keep the text size as per the original point size? procedure Layer_Scale; var hL : handle; LayerName : string; NowScale, NewScale : real; LayerCount, i : integer; begin hL := ActLayer; LayerName := GetLName (hL); NowScale := GetLScale (hL); NewScale := RealDialog ('Layer Scale : ', Num2Str (2, NowScale)); LayerCount := NumLayers; Layer (GetLName (FLayer)); hL := ActLayer; for i := LayerCount downto 1 do begin if (GetLScale (hL) = NowScale) then SetLScale (hL, NewScale); if (i <> 1) then hL := NextLayer (hL); end; Layer (LayerName); end; run (Layer_Scale);
  19. Thanks DeSignature, you've killed two birds with one stone. You are right, componentID 1 & 2 are reserved for OK & Cancel. Also, by identifying this, you have resolved the issue of Tab sequence. After removing 1 & 2 I don't need SetFocusOnItem because, as I assumed, the Tab sequence starts with 3 and moves through the componentID sequentially. Hope this post helps others because finding this information from Vectorworks Help is impossible. I'm happy ..... for now.
  20. Maybe you are right Raymond but what you suggested doesn't work for me. SetFocusOnItem (TBdialog1, 2) doesn't do what it says. Here's where I am today: procedure TB; var Client, DelDate : string; TBdialog1, Result : longint; procedure Dialog_Handler_1 (var Item : longint; Data : longint); begin SetFocusOnItem (TBdialog1, 2); GetItemText (TBdialog1, 2, Client); GetItemText (TBdialog1, 4, DelDate); end; procedure User_Form1; begin TBdialog1 := CreateLayout ('Title Block Text', False, 'OK', 'Cancel'); CreateStaticText (TBdialog1, 5, 'Rev.:', 6); CreateEditText (TBdialog1, 6, '3', 3); CreateStaticText (TBdialog1, 7, 'Part`rs:', 8); CreateEditText (TBdialog1, 8, '4', 43); CreateStaticText (TBdialog1, 9, 'By:', 5); CreateEditText (TBdialog1, 10, '5', 7); CreateStaticText (TBdialog1, 11, 'Date:', 6); CreateEditText (TBdialog1, 12, '6', 11); CreateStaticText (TBdialog1, 1, 'Client:', 14); CreateEditText (TBdialog1, 2, '1', 53); CreateStaticText (TBdialog1, 3, 'Del. Date:', 14); CreateEditText (TBdialog1, 4, '2', 11); SetFirstLayoutItem (TBdialog1, 5); { Rev } SetRightItem (TBdialog1, 5, 6, 0, 0); { Rev Box } SetRightItem (TBdialog1, 6, 7, 0, 0); { Rev Part'rs } SetRightItem (TBdialog1, 7, 8, 0, 0); { Rev Part'rs Box } SetRightItem (TBdialog1, 8, 9, 0, 0); { Rev By } SetRightItem (TBdialog1, 9, 10, 0, 0); { Rev By Box } SetRightItem (TBdialog1, 10, 11, 0, 0); { Rev Date } SetRightItem (TBdialog1, 11, 12, 0, 0); { Rev Date Box } SetBelowItem (TBdialog1, 5, 1, 0, 0); { Client } SetRightItem (TBdialog1, 1, 2, 0, 0); { Client Box } SetRightItem (TBdialog1, 2, 3, 0, 0); { Del. Date } SetRightItem (TBdialog1, 3, 4, 0, 0); { Del. Date Box } end; begin User_Form1; if (VerifyLayout (TBdialog1) = True) then Result := RunLayoutDialog (TBdialog1, Dialog_Handler_1); { Result is OK (1) or Cancel (2) } if (Result = 1) then message (Client, ' ', DelDate); end; run (TB);
  21. Tried this myself. Since I new the file path and the new file name I ended up using: Response := StrDialog ('Filename:', FName)); the user copied this highlighted string and then DoMenuTextByName ('Save As...',0); pasting in the copied string (file name and path) I was told the path was an operating system function and not controllable in VW. You will note that if the Save As... is used once then the following Save As's will be to the same location.
  22. You guessed it Raymond, that's not what I want to do. This is my first attempt at moving to the modern dialog procedures so I am at layout stage at the moment. With the code below I will want to start in the Client text box and move to Del. Date, Rev., Part'rs, By, and Date. So the tabbing sequence should be 1, 2, 3, 4, 5, 6, OK as seen in the popup Dialog box. In the old dialog procedures, tabbing was sequenced on the componentID. procedure TB; procedure User_Form1; var i : integer; TBdialog1, result : longint; begin TBdialog1 := CreateLayout ('Title Block Text', False, 'OK', 'Cancel'); CreateStaticText (TBdialog1, 5, 'Rev.:', 6); CreateEditText (TBdialog1, 6, '3', 3); CreateStaticText (TBdialog1, 7, 'Part`rs:', 8); CreateEditText (TBdialog1, 8, '4', 43); CreateStaticText (TBdialog1, 9, 'By:', 5); CreateEditText (TBdialog1, 10, '5', 7); CreateStaticText (TBdialog1, 11, 'Date:', 6); CreateEditText (TBdialog1, 12, '6', 11); CreateStaticText (TBdialog1, 1, 'Client:', 14); CreateEditText (TBdialog1, 2, '1', 53); CreateStaticText (TBdialog1, 3, 'Del. Date:', 14); CreateEditText (TBdialog1, 4, '2', 11); SetFirstLayoutItem (TBdialog1, 5); { Rev } SetRightItem (TBdialog1, 5, 6, 0, 0); { Rev Box } SetRightItem (TBdialog1, 6, 7, 0, 0); { Rev Part'rs } SetRightItem (TBdialog1, 7, 8, 0, 0); { Rev Part'rs Box } SetRightItem (TBdialog1, 8, 9, 0, 0); { Rev By } SetRightItem (TBdialog1, 9, 10, 0, 0); { Rev By Box } SetRightItem (TBdialog1, 10, 11, 0, 0); { Rev Date } SetRightItem (TBdialog1, 11, 12, 0, 0); { Rev Date Box } SetBelowItem (TBdialog1, 5, 1, 0, 0); { Client } SetRightItem (TBdialog1, 1, 2, 0, 0); { Client Box } SetRightItem (TBdialog1, 2, 3, 0, 0); { Del. Date } SetRightItem (TBdialog1, 3, 4, 0, 0); { Del. Date Box } result := RunLayoutDialog (TBdialog1, Nil); end; begin User_Form1; end; run(TB);
  23. Using the following Vectorscript example straight from the help I have inserted the line SetFocusOnItem (id, 7); but I can't get it to work. Have I tried different locations and different component IDs but it has no effect. What's wrong? PROCEDURE CreateDialog; VAR id: LONGINT; result : LONGINT; BEGIN id := CreateLayout ('Revise Layer Link', TRUE, 'Update', 'Cancel'); CreateStaticText (id, 4, 'Relink to:', -1); CreatePulldownMenu (id, 5, 32); CreateGroupBox (id, 6, 'Link Options', TRUE); CreateCheckBox (id, 7, 'Link object is locked'); CreateCheckBox (id, 8, 'Name Link:'); CreateEditText (id, 9, 'Untitled Link', 26); SetFirstLayoutItem (id, 4); SetBelowItem (id, 4, 6, 0, 0); SetFirstGroupItem (id, 6, 7); SetBelowItem (id, 7, 5, 0, 0); SetBelowItem (id, 5, 8, 0, 0); SetBelowItem (id, 8, 9, 0, 0); SetFocusOnItem (id, 7); result := RunLayoutDialog (id, NIL); END; RUN(CreateDialog);
  24. I just found that compatibility mode was reset to Win'XP SP1 so I fiddled a bit and found Win'Vista SP2 is a better option. Compatibility is found when you right click on the start bar icon of VW (or any shortcut) and choose properties and then the compatibility tab.
  25. Just to keep you updated on the Office 365 vs Vectorworks 2012 problem, I waited a day and a bit for Microsoft to ring me before trying this: From the start menu I right clicked on Vectorworks and chose ?Troubleshoot Compatibility?. After going thought the steps VW 2012 works again with a few weird happenings. First, most of my pallets have a black boarder. Secondly my snapping pallet (which is the only one that doesn't have a black boarder) doesn't stay in the 2 x wide, 4 x deep format after I close and re-open VW. I can put up with the weirdness since VW still works. Thanks for the suggestions.
×
×
  • Create New...