Jump to content

MullinRJ

Member
  • Posts

    2,007
  • Joined

  • Last visited

Everything posted by MullinRJ

  1. Cairo9, Custom Selection will enable you to do #3 directly, w/o knowing how to script. Goto menu Organize>Custom Selection... If you want to look at the script this will generate, select "Create Script", otherwise leave the selection on "Execute Immediately". When you look at the script, "&" means AND, and, "|" means OR. ("|" is a vertical bar, not a capital "i".) Press the "Criteria" button. You will need 3 categories to get Rectangles with 2 colors, so press the "More Choices" button twice. First Choice: Type - is - Rectangle Second Choice: Fill Back Color - is - RED (choose color from palette) Third Choice: Fill Back Color - is - GREEN (choose color from palette) Check the User's Manual for more details. HTH, Raymond
  2. Hi Jim, No, I get a file named "VectorScriptLG11.pdf". I went to the second link I posted and downloaded the first link on the page. No ACAD stuff. Raymond
  3. Hi Jim, The online reference guide is at: http://www.nemetschek.net/support/custom/vscript/functionref/VSFunctionReference.html The documentation download page is at: http://www.nemetschek.net/support/custom/vscript/docs.html Sorry, I do not know the replacement commands, but if you can't find them in the VS Function Reference, I'm sure somebody will point them out to you. Raymond
  4. Hi David, In your Dialog Driver routine you can use either SetField(11, 'a different label'); { All versions } or SetControlText(dlogID, 11, 'something else'); { introduced in v10.0 } They both work. You can also change the text for check boxes and radio buttons the same way. HTH, Raymond
  5. David, It is part of a CASE statement in the Drive_LayerClassT procedure. "1" is the item number returned when OK button is pressed. Raymond
  6. quote: The stacking order doesn't matter at all to me, as I don't think I ever have two lights on top of each other.Sam, That is kind of what I was thinking. Glad it worked for you. Charles script looks like it would work if you ever needed to keep the stacking order intact, but I would put the call to "objCount" outside the while loop and reference it with a variable, since the count won't change during program's execution. It's an easier approach than I originally tried before I decided to shuffle the objects instead of the ID's. Happy scripting, Raymond
  7. PastTenseSam, This may not be what you want, but if the stacking order of the lighting units on the layer is not important to you, it is easier to reorder them than to reorder the unit numbers. If you can live with it, here is a quick and dirty Bubble Sort routine that orders the units from Left to Right before you number them. You can modify it for other directional sorting as your needs require. code: PROCEDURE RenumberLR; VAR h : HANDLE; unitbase : INTEGER; procedure SortLtoR; { Change the ordering of objects on the layer based on the object's horizontal position } { using a short, left to right, bubble sort - can take a while if the list is long. } Var swap :BOOLEAN; X1, X2, Y :REAL; Begin swap := True; while swap do begin { repeat until no more swaps occur } swap := False; h:= FSActLayer; while (NextSObj(h)<>nil) do begin hCenter(h, X1, Y); hCenter(NextSObj(h), X2, Y); if (X1>X2) then begin hMoveForward(h, false); { swap object stacking order } swap := True; end; { if } h:= NextSObj(h); end; { while } end; { while } End; { SortLtoR } BEGIN SortLtoR; { order the units from L to R first, then number them } unitbase:= 0; h:= FSActLayer; WHILE (h <> NIL) DO BEGIN unitbase:= unitbase+1; { on loop exit, unitbase = number of units } SetRField(h, 'LightInfo', 'Unit', Num2Str(0, unitbase)); h:= NextSObj(h); END; { while } END; Run(RenumberLR);[/code] HTH, Raymond (aka SamIAint) [ 12-11-2004, 09:16 PM: Message edited by: MullinRJ ]
  8. Hi kurt7717, If you give your counter a name (eg. 'Kitchen Counter'), then when you are in the spread sheet you can use: =AREA(N='Kitchen Counter')/144*60 The /144 assumes your drawing is in inches and will convert from sq in. to sq ft. The *60 you should recognize as your price/sq ft. HTH, Raymond
  9. Cairo, You have taken the first step on a long and interesting journey. Yes, the script window can hold scripts that do a wide variety of tasks, even move an object 6". Scripts can be very simple (1 line) or very complex (thousands of lines). Most scripts that you will find useful on an everyday basis will be short, and you can learn to write them yourself, either by example or self taught. I recommend "by example" for a faster, less frustrating initial experience. You will need two documents from the NNA site: the VectorScript 11 Function Reference, and the VectorScript Language Guide. They can be found at: www.nemetschek.net/support/custom/vscript/docs.html. There are some good examples you can look at there, too. Also, check out VectorDepot at: www.VectorDepot.com. There are a LOT of good examples there, and most are at a very reasonable price - FREE. New script objects can be created from the Resource Browser window by clicking on the button with the arrow to the right of the word "Resources". You can also copy and paste scripts from one document to another via the clipboard. Welcome to VectorScripting, Raymond
  10. Answer to question 2, YES. With Custom Selection open, click the More Choices button (twice) and set your criteria for selection. Line Weight = 6, Type = Rectangle, Fill Back Color = (choose the black color from the color palette). Click the OK button. If it doesn't work, try the Fill Fore Color, but solid fills are almost always background fills unless you set them to foreground either manually or by script. Raymond
  11. Hi Cairo, Try using this in a short script: code: DSelectAll; SelectObj((LW>6) & (LW<12));[/code][/indent] I used the Custom Selection menu to select a LW of 6 and had it save to a script. Then I edited the script to add the second term and changed the '=' to '>' and '<' in the two terms and the values to 6 and 12 respectively. The '&' character means AND. The '|' character means OR. So the statement reads: Deselect everything. Then Select all objects that meet the criteria: LW>6 mils AND LW<12 mils. If you want an inclusive range, use: code: DSelectAll; SelectObj((LW>=6) & (LW<=12));[/code][/indent] Raymond
  12. Jim, There will not be an explanation in the VW11 docs. The only place I have seen the list written is the back of the MiniPascal Manual for version 5. It was not in any of the later versions. They stopped printing the books at MC7 and have been using PDF docs since. Perhaps the NNA tech support could send you a list. If you have any more numbers you need, I'll be happy to look them up for you. Raymond PS - I'm glad I'm somebody.
  13. The inches symbol is the Double Quote. Try: 21' 11 7/8"
  14. Sorry Jim, You are in limbo for WS commands with VW8. VW9 saw a plethora of new commands introduced, including RecalculateWS(), which I believe you are looking for. My knowledge of WS manipulation is limited, but from looking at the VW8 VS Language Reference, there isn't much to work with, including the DoMenuTextByName options. If you need your scripts to work, I'd recommend you update your software and take advantage of a much broader language support. You might be able to find versions of VW9 or VW10 on EBay if you can't afford to jump to VW 11 right now. Personally, I'd go to VW10, it is very stable in it's scripting. Maybe somebody else has a ReCalc trick they can offer. Raymond
  15. Hi Jim, Here's the short answer, (as if there ever is one). The original call DoMenu() was defined in the MiniPascal Language Manual as: procedure DoMenu(menuItem, modifierKey); The arguments are of type Integer or Longint, since the values passed are constants. The letter "M" preceded the menu name (with blanks removed) to define a constant that the compiler used. NoKey, OptionKey, ShiftKey, and CommandKey are constants that define what modifier key is pressed, since some menus have multiple appearances. Most DoMenu calls use the NoKey modifier. Some, like the Duplicate menu have two commands in the same menu position. Duplicate is the default (NoKey) menu and Duplicate Array... is the hidden (OptionKey) menu. To invoke them from your program you would use: DoMenu(MDuplicate, NoKey); { Duplicate command } DoMenu(MDuplicate, OptionKey); { Duplicate Array command } So, to use the newer DoMenuTextByName command for these two commands, you need to strip the "M" and type them as follows: DoMenuTextByName('Duplicate', 0); DoMenuTextByName('Duplicate Array', 0); The menu names should be typed exactly as seen in the real menu, but in some the ellipses are removed. The "0" is used for individual menus. Numbers other than "0" are use for sub-menu indexing using Menu Chunks. The Font>Size menu is a good example. For 10 point text, use the following: DoMenuTextByName('Font Size', 3); where 10 pt is the third item in the Size sub-menu. The names of the Chunk menus are found in the VS Function Reference Appendix, sometimes including the word "Chunk", and sometimes not. OK, too much info. Where there are existing, or newer, VS commands that do the same functions, it is preferred you use them, rather than using the DoMenuTextByName() command. Somewhere it is written that DoMenuTextByName commands should be avoided, but the VS language is incomplete and invoking a menu action is the only way to get some things done. Lastly, MReCalc is the ReCalc menu (used to recalculate Worksheets), MPageSetup is the "Page Setup" menu, and 1426 is the "Fit To Page" menu. To the best of my knowledge, none of this is online. The old MiniPascal Manuals are still worth their weight in gold. Good luck and HTH, Raymond
  16. Create a VS with this line: SetPref(14, not GetPref(14)); and call it "Toggle SOIG", or some such name. It will toggle the "Show Other Objects While In Groups" preference back and forth. Have you looked at VectorDepot? www.vectordepot.com/ Raymond
  17. Jeff, To recover the 2D part(s) of an extrude: Select the Extrude. Go to menu Organize>Edit Group, or Cmd-[ Select all and copy. Go to menu Organize>Exit Group, or Cmd-], or press the Done button in the upper right of the screen. Paste, or Paste In Place, wherever you like. HTH, Raymond
  18. Hi Tom, Why would I kid you? How often do you do this, or need to do this? A VS wouldn't be too difficult to write. Raymond
  19. Convert the arc to a Polyline, which may be easier said than done. I did not find a command to do this, so here's what I did. 1) Duplicate the arc for safety's sake. 2) Group it. 3) Change the width of the group then change it back. (eg - ∆X = 335.3, change to 335.31 and back to 335.3. Arc will now be a Polyline with 4 points.) 4) Delete the offending center point, either onscreen or with the OIP. 5) Now, the middle point on the curve is a Bezier Point, but if you want an Arc Point, use the Arc Smoothing menu under Edit>Smoothing>Arc Smoothing. Now you can adjust the Radius in the OIP, if need be. 6) Delete the original when you are satisfied. Is there and easier way? One could write a script if there were a lot to do. HTH, Raymond
  20. Viper X, How many levels of UNDO are set in your VW Prefs (under the Session Tab)? Mine is set to 20 and I have never had memory problems, but my files are also smaller than yours (1-4MB). Try lowering it and see if your memory usage gets reined in. This doesn't explain memory leaks, but it might slow your memory consumption. I have no idea why it would increase while you do nothing. Raymond VW 10.5.0, Mac G4, OSX 10.2.8
  21. Hi Jim, Translating scripts from MC6 to VW11 should not be a terribly difficult undertaking. There are some minor syntax changes, and a few obsolete commands, but in all, it will be pretty straight forward after you do a few. Most of the commands that worked then still work. The biggest change to the language is the addition of many new commands that control all the new features that have been added to the program. What you may find after you start working with VW11 is that you will want new or modified scripts to make use of the new features. The addition of PIO's (with VW8, I believe) has greatly changed the way people work, and with VW11, viewports seem to be the big buzz. If you find Joe and he can help you, great. If not, keep writing back. There are many here who contribute a lot of their time just for the asking. Good night Joe DiPaula, wherever you are... Raymond
  22. Hi Mickey, PIO stands for Plug-In-Object. It refers to objects that have some intelligence built in, via scripting. Many of the Whiz-Bang objects that NNA supplies with the package are PIO's (like windows and doors, etc.). You can also develop your own, or use ones that have been developed by third parties. There are also a few flavors of PIOs. Menu Objects are scripts that are placed in the menu bar and can be invoked by hot-keys. Tool Objects enable the creation of new and more sophisticated tools that place and shape objects on the drawing, interactively or through the OIP (Object Info Palette, which is where object data is displayed in detail). There are also Path Objects which will draw custom details along a user defined path. If I've missed any, someone else will elaborate. HTH, Raymond
  23. Hi Anne, You can also use the Duplicate Array command. 20% of the linear distance is also 20% of the angular distance, in this case 90? x 0.20 = 18?. Draw the first line, adjust it if necessary and leave it selected. Then choose "Duplicate Array..." under the Edit menu. Select the Circular option. Number = 5 and Angle = 18 or -18, depending which way you want to rotate your copies. Positive angles rotate CCW. If you know the coordinate of the center of your circle, type it in, OR choose the Next Mouse Click option and press OK. If you chose Next Mouse Click, you will have a target cursor. Place it over the point for the center of rotation and click. Voila. If it's not what you wanted, Undo and try again. Check your constraints. Snap To Object should be on. There's usually more than one way to do most things in CAD. HTH, Raymond
  24. quote: I wish to exclude these objects, and only find the objects which are actually touching or crossing the bounding box.Ah, but you did not say that explicitly. Try: code: A := PtInRect(L1, T1, L2, T2, R2, B2); B := PtInRect(R1, T1, L2, T2, R2, B2); C := PtInRect(R1, B1, L2, T2, R2, B2); D := PtInRect(L1, B1, L2, T2, R2, B2); E := PtInRect(L2, T2, L1, T1, R1, B1); F := PtInRect(R2, T2, L1, T1, R1, B1); G := PtInRect(R2, B2, L1, T1, R1, B1); H := PtInRect(L2, B2, L1, T1, R1, B1); Intersect := (((L1 <= L2) & (R1 >= R2)) & ((T1 <= T2) & (B1 >= B2))) | (((L1 >= L2) & (R1 <= R2)) & ((T1 >= T2) & (B1 <= B2))) | ((A | B | C | D | E | F | G | H) & not ((A & B & C & D) | (E & F & G & H)));[/code] The first two lines find tall skinny Rects and short wide Rects that overlap with no corners inside the other Rect. The third line finds Rects where at least one corner is inside the other Rect, and the last line excludes all corners of one from being inside the other. Of course, A through H are declared as booleans. As written, if the two Rects are equal, Intersect will return TRUE. If you want to filter equal Rects, add "& not EqualRect(L1, T1, R1, B1, L2, T2, R2, B2)" to the expression. To answer your question, I don't think there is a simple way to express what you want. However, once you get it working to your satisfaction, you can define it as a Function and and make a single line VS call for future invocations. HTH, Raymond
  25. Hi Peter, I use: code: Intersect : Boolean; L1, T1, R1, B1 : REAL; { Left, Top, Right, Bottom } L2, T2, R2, B2 : REAL; Intersect := (((L1 <= L2) & (R1 >= R2)) & ((T1 <= T2) & (B1 >= B2))) | (((L1 >= L2) & (R1 <= R2)) & ((T1 >= T2) & (B1 <= B2))) | PtInRect(L1, T1, L2, T2, R2, B2) | PtInRect(R1, T1, L2, T2, R2, B2) | PtInRect(R1, B1, L2, T2, R2, B2) | PtInRect(L1, B1, L2, T2, R2, B2) | PtInRect(L2, T2, L1, T1, R1, B1) | PtInRect(R2, T2, L1, T1, R1, B1) | PtInRect(R2, B2, L1, T1, R1, B1) | PtInRect(L2, B2, L1, T1, R1, B1);[/code] This will also catch overlapping dimensions. Raymond [ 10-13-2004, 02:55 PM: Message edited by: MullinRJ ]
×
×
  • Create New...