Jump to content

WhoCanDo

Member
  • Posts

    435
  • Joined

  • Last visited

Everything posted by WhoCanDo

  1. 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);
  2. 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.
  3. 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);
  4. 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.
  5. 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);
  6. 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);
  7. 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.
  8. 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.
  9. Hi, Just installed Microsoft's Office 365 we based software and Vectorworks 2012 has stopped working with: Problem signature: Problem Event Name: BEX Application Name: VECTOR~1.EXE Application Version: 17.0.5.0 Application Timestamp: 50379bde Fault Module Name: StackHash_4c0d Fault Module Version: 0.0.0.0 Fault Module Timestamp: 00000000 Exception Offset: 00000000 Exception Code: c0000005 Exception Data: 00000008 OS Version: 6.1.7601.2.1.0.256.48 Locale ID: 3081 Additional Information 1: 4c0d Additional Information 2: 4c0d4d78887f76d971d5d00f1f20a433 Additional Information 3: 4c0d Additional Information 4: 4c0d4d78887f76d971d5d00f1f20a433 Anyone else had problems with Office 365?
  10. Because one of my customers has sent me a .dwg drawing with different scales on different layers I would like to customise the dimension units as I view each layer. I know that I can't set each layer to a different dimension unit scale so I would like to use a macro to easily change the dimension units as required. eg. the standard setting is 25.4 units per inch for metric The drawing shows 0.99999 but I know the scale is 1:50 so the dimension should be 50 rounded to no decimal places. ie "Smaller from Larger" should be 50 units per Millimeter. I had a look through the functions but I can't find one that does this. Any suggestions? Regards
  11. I have just copied and pasted this into a VS palette and the macro works fine. I have also copied and pasted it into a new VS Plug-in type Tool which also works for me. Can't offer a reason why it doesn't work for you though. Regards
  12. I want a symbol with pre-filled record information. Lets call it hook. 1. If have drawn a hook then attach a record and fill in the record with Name, Length, Qty & Weight. I then pick the hook and create symbol. Placing this symbol on the drawing does not initially show and record attached but editing the symbol shows that it still has a record with data. 2. If I right click on the symbol in the Resource Browser I have the option of "Attach" which allows me to choose from the record formats available. "Attach" does not attach anything and there does not seem to be be a way of adding data to the record even if it did. 3. Working with 1. above, even though there is data embedded in the symbol, this data does not show up on the worksheets. I don't want to change the symbol to group during insertion because I lose the ability to revise all instances by editing the symbol. Is this a bug or am I missing something here?
  13. WhoCanDo: for i := 4 to 6 do begin CreateThreeStateCheckBox (DialogID, i, Concat (' ', i)); SetBelowItem (DialogID, i - 1, i, 0, 0); end; Thanks Raymond
  14. No that didn't work unless I don't understand you correctly.
  15. Like this: for i := 4 to 6 do begin CreateThreeStateCheckBox (DialogID, i, Concat (' ', i)); SetBelowItem (DialogID, i - 1, i, 0, 0); end;
  16. for i := LayerCount -1 downto 1 do begin h := NextLayer (h); LayerName := GetLName (h); end; No luck Pat, The original post was with spaces and the above is with spaces and "begin" has a tab. I have previewed this reply after copying from VW, copy & paste through Word, WordPad & Notepad but nothing works. I even added spaces after pasting but everything in the forum seems to be left justified. Is there a switch I need to flick in My Stuff? I have seen many people with my problem and I have also seen several comments from replies saying please format your code which is what I would like to do. Any other ideas?
  17. The webpage http://www.artlantis.com/index.php?page=download/plugin/index has a dropdown list which includes VW. Download the plugin and then copy it to c:\document and settings\your login account\Application Data\Nemetschek\Vectorworks\2010\Plugins In VW use Tools\Workspaces\Workspace Editor to add it to your menu What's wrong with Solidworks?
  18. Hi, I've cut and pasted from the VS Editor several times and as I am writing this post I see the format is correct. ie "for" is left justified and "begin" is two spaces in as is Create, Set & end; for i := 4 to 6 do begin CreateThreeStateCheckBox (DialogID, i, Concat (' ', i)); SetBelowItem (DialogID, i - 1, i, 0, 0); end; but when I hit "Submit", everything is left justified. This is OK for above but when there are many more lines of code it becomes harder to read. What am I doing wrong?
  19. Hi, Since BeginDialog is comming to its end, I want to try and convert my macros to CreateLayout but I can't find much help or examples. With the below, what is the next step to identify which box is checked? procedure test; var i, OI : integer; DialogID : longint; procedure Dialog_Handler (var a : longint; b : longint); begin end; begin DialogID := CreateLayout ('CHOOSE', False, 'OK', 'Cancel'); CreateStaticText (DialogID, 3, 'Choose !', 30); SetFirstLayoutItem (DialogID, 3); for i := 4 to 6 do begin CreateThreeStateCheckBox (DialogID, i, Concat (' ', i)); SetBelowItem (DialogID, i - 1, i, 0, 0); end; if (VerifyLayout (DialogID)) then If (RunLayoutDialog (DialogID, Dialog_Handler) = 1) then begin SetThreeStateCheckBoxState (DialogID, 4, 1); for i := 4 to 6 do begin GetThreeStateCheckBoxState (DialogID, i, OI); message (OI);wait(0.5);clrmessage; end; end; end; run (test);
  20. Quote: "Each of my temp dimmers has a record and field 'Dimming Data'.'Dimmer Name'. There are only individual entities at the moment so no double ups." so if there are no doubles then you expect SelectObj to only select one item, therefore ForEachObject will know the handle no matter which layer it is on. With procedure Record_H (h : handle); begin DIMH:=h; end; you will record h from any layer. Regards
  21. I've always wondered why SelectObj isn't: SelectObj (c:Criteria):FSHandle; ( 1st selected handle ) and SelectObjs (c:Criteria); How much easier life would be. However ForEachObject (DoThis, ('Dimming Data'.'Dimmer Name'=LDCIRCUIT)); may help!! Regards
  22. Hi, Sysbeep offers only the current system prompt sound. I know I can change the system prompt sound but I would like a variety of sounds that mean different things to me. How can my macros to choose and play a .wav or .mpg or etc. from VW? Regards Trevor
  23. Thanks Raymond, I was looking for something like SetLayerColorToggle but that's too sensible. Regards
  24. Hi, What is the VectorScript proceedure to toggle the "Document Preferences/Display/Use layer colors" on and off?
  25. I only have Fundamentals that does not allow printing to pdf but that's not a problem because I have been using pdf995 as a pdf printer long before VW decided to incorporate it. Printing to pdf995 does not have the same problems as you are having so it could be an option for you. Regards
×
×
  • Create New...