Jump to content

MullinRJ

Member
  • Posts

    2,017
  • Joined

  • Last visited

Everything posted by MullinRJ

  1. GJ, Is the object in the symbol a text object? I ran your script and got no errors changing a text object inside a symbol. VW 10.5.0 on MAC OS 10.2.8. To see the changes to the symbol in your drawing you will have to put a RedrawAll; after the SetText(); command. Even without the RedrawAll;, the printed output showed the updated date. quote: but I get all kinds of errors in when I try to add it to editing a specific symbol definition.Since named objects are unique, you don't have to edit the symbol definition to modify the DATE string inside, just run the code you have above. There will only be ONE object in your file named DATE, and even if it is in a Symbol Definition, GetObject('DATE') will return a handle to it. Can you list the errors you are getting, or the symptoms? Maybe I don't understand exactly what you are doing, so it will help clarify things. Raymond
  2. Andrew, Here is a one line VS command that will let you toggle the Zoom Line Thickness preference: SetPref(9, not GetPref(9)); Create a script in a script palette with this, or goto www.vectordepot.com/plugins1.shtml and look for Toggle Lineweight Zooming (more than halfway down). You can add this to your plugins folder, then add it to your workspace (it's a menu command and you should find it under Miscellaneous) and assign a keyboard shortcut to your new menu command. You can then toggle the preference on and off at will. Now your new program will be Turbo Charged. All the best, Raymond
  3. Hi Kiwi, Nice script, thanks. I think you need one change in the loop where you save the handles. You have: FOR i:=1 TO j DO BEGIN {this keep on memory the objects handle} MyH:=h; h:=NextObj(h); END; I think "h:=NextObj(h);" should be "h:=NextSObj(h);", so it just saves the handles of selected objects. All the best, Raymond
  4. It looks like you are doing this in a PIO. If so, use: BoolResult := GetCustomObjectInfo(objectName, objectHand, recordHand, wallHand); to return a handle to thePIO you are creating. I think myHnd:=FIn3D(objectHand); should return a handle to the first object you created (as numbered below). rect(0,carc_d,19mm,0); { 1 } rect(carc_w-19mm,carc_d,carc_w,0); { 2 } rect(0,0,carc_w,-20mm); { 3 } rect(19mm,carc_d-21mm,carc_w-19mm,carc_d-25mm); { 4 } Moveto(19mm,carc_d); line(carc_w-19mm,0); { 5 } Test myHnd before using it. if (myHnd<>nil) then begin end; Use myHnd:=NextObj(myHnd); to get the second object, etc. If you are in a normal script, use myHnd:=LNewObj; to return a handle to the last object you created (i.e., the line), and use myHnd:=PrevObj(myHnd); to get the second to the last object, etc. These suggestions are off the top of my head, so use with caution. Raymond
  5. Alan, Is your arm entirely on your work table? Though everyone has different preferences, I am not sure the weight of the mouse is the complete cause of wrist problems. As you know, there are many factors that contribute to fatigue during repetitive tasks. The added weight of a cordless mouse may be exacerbating a marginal problem that a lighter mouse allows you to ignore. I really cannot say without seeing your entire setup, so it may be exactly as you say - heavy mouse causes fatigue. I would also like to hear how your chair and table are configured. That was somewhat longwinded, sorry. I do have a point to make that I think many computer users overlook. Supporting the forearm on the table where the keyboard and mouse reside is key to relieving stress on the wrist. If the elbow is off the desk so that the edge of the desk presses into the forearm, it's only a matter of time before real pain sets in. Or if the elbow sits on the armrest of the chair, and that height is not the same as the desktop, pain. Very few computer tables I have seen are deep enough to lay your forearms entirely on the table (My Mom's is the worst with a slide-out keyboard drawer). With LCD monitors, it should now be possible to reassign desktop real estate, but if you are not already doing so, push the keyboard and mouse pad at least a foot into the table and I think a lot of stress will be relieved from the support. All the best, Raymond (love my Logitech cordless mouse) Mullin
  6. Hi Kiwi, I have done a lot with modeling Polylines using the parameters available in VS to recreate the curves. My downfall has been VW implementation of the cubic spline. Beziers and Arc control points are no problem, and CubicSpline control points surrounded by CornerPoints are also managable. However, I have trouble when there are a string of CubicSpline points in a row. I have requested technotes on the implementation of the various control points for Polylines from NNA in the appropriate techboard section, but never heard anything from them. I would be happy to compare notes with you. If you'd like to contact me, I can be reached at mullinrj at aol.com What you have pointed out is very interesting and I would also like to compare it to a math model in another environment. All the best, Raymond
  7. Hi Kiwi, Yes, it works for me. The new vertex appears between the first and second points in the POLY. I ran the following in VW 10.5 without problem. Of course, a Poly must be on the active layer and be the only, or at least the first, selected object. How are you passing the X and Y values? Are you passing them between procedures as I did below, or are you getting them from outside your program? Interactively? Or from a file? Try using the debugger or place a Message() statement in your program to see what the values of X & Y are. Raymond code: procedure xxxx; procedure ModPoly(H :Handle; X, Y :Real); Begin InsertVertex(H, X, Y, 2, 0, 0); End; BEGIN ModPoly(FSActLayer, 100, 100); END; Run(XXXX);[/code]
  8. Hi Pamela, There is also an example on the NNA website at http://www.nemetschek.net/support/custom/vscript/example.html that shows how to do what you want. It's the second from the bottom of the page (2-D Path Object). You may have to customize it for your needs, but that's half the fun. Good luck, Raymond
  9. SetTool(-241); { Pan Tool }
  10. 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
  11. 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
  12. 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
  13. 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
  14. 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
  15. 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
  16. 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 ]
  17. 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
  18. 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
  19. 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
  20. 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
  21. 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.
  22. The inches symbol is the Double Quote. Try: 21' 11 7/8"
  23. 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
  24. 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
  25. 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
×
×
  • Create New...