Jump to content

MullinRJ

Member
  • Posts

    1,990
  • Joined

  • Last visited

Everything posted by MullinRJ

  1. Digi'M, ???You are almost there with your VW generated script. Unfortunately, VW does not take it to the next step, which is to set up a loop to check multiple conditions. For that, you have to do a little scripting yourself. ???Luckily for you, I have one here. The trick that makes this work is knowing how to pass a <criteria> expression to one of the VS calls that require it for input. ???This is the part that is not easily found in the documentation: VAR CRITERIA :STRING; and you can build your own string and pass the result to a waiting VS command for further processing. If the string is malformed it may compile but you will either get a runtime error or no action at all. ???In your case I built the string from 3 pieces and glued them together with the concat() function. The first and third pieces are static text, while the middle part is the number you want to insert as a wildcard. PART 1) eotroads_ PART 2) #???( a number from 1 to 999 ) PART 3) Rec.Class = 5 ???When assembled, it will look like this (when # = 12): eotroads_12Rec.Class = 5 PROCEDURE SelectByRec; { Select objects that match the criterion "eotroads_###.Class = 5", } { where ### = 1 to 999. } VAR I :Integer; S :String; BEGIN DSelectAll; for I := 1 to 999 do begin S := concat('eotroads_', I, 'Rec.Class = 5'); { criterion in string form } SelectObj(S); end; END; Run(SelectByRec); ???I'm not sure what you are doing, but Pat's first comment might make your life easier, if you can change your record strategy. Tell us more about what you are doing and someone out here mighgt have some good ideas on how to use the software better. HTH, Raymond
  2. I use nested includes extensively in Reshaper. Fifty-five files, three levels deep; No problem. I don't know if this is necessary, but I use the full file path name, and I also use the Windows path name delimiters "/" for cross platform stability. Raymond
  3. There is no command to FLIP objects by handle. There shoiuld be, but there is not. The way you are doing it is the only way I know of to do it, except as Miguel mentioned, draw it flipped if you can. Raymond
  4. I believe you can use the Underscore character "_" (Shift-Minus) in parameter names. Raymond
  5. Hi John, ???You will have to set up a loop to read every record until you find the one with: NoBearings=2 Use the POS() function to identify it and exit your loop. Then read the next two records and dissect each one accordingly. Have fun, Raymond
  6. Thanks, Ed. That site has a diverse, a very diverse, collection of videos. Thanks for sharing. Raymond
  7. Hi John, I do this a lot. Here is a sample script. You'll have to add a loop and a READLN() to import multiple records. HTH, Raymond PROCEDURE ParseIt; { Copyright 2010 Raymond J. Mullin } CONST Comma = ','; VAR S, T :String; param1 : Integer; param2 : Real; param3 : String; param4 : Boolean; function GetParam (var S :String; Delim :Char) :String; { Return the first substring of S up to the Delim character, } { and delete the substring from S. } Var DelimPos : Integer; Begin DelimPos := pos(Delim, S); if (DelimPos > 0) then GetParam := copy(S, 1, DelimPos-1); delete(S, 1, DelimPos); end else GetParam := ''; End; { GetParam } function UpperStr (S :String) :String; { Return UPPER CASE of String S. } Begin UprString(S); UpperStr := S; End; { UpperStr } BEGIN S := concat(7, Comma, 15.2, Comma, 'Texty Stuff', Comma, 'True'); { test string } T := S; { a copy of S } S := concat(S, Comma); { add a delimeter to the end of S if one is not already there } param1 := Str2Num(GetParam(S, Comma)); param2 := Str2Num(GetParam(S, Comma)); param3 := GetParam(S, Comma); param4 := UpperStr(GetParam(S, Comma)) = 'TRUE'; message(T, ' ---> ', param1, ' ', param2, ' ', param3, ' ', param4); END; Run(ParseIt);
  8. This is not exactly what you want, but if you click in the drawing before a paste operation (not Paste In Place) the object(s) on the clipboard will paste at that new location, but the BBox center will be the relative insertion point. You may have to move it a little after pasting, but at least it won't paste across the drawing somewhere. Another feature you can use is the Symbol Pickup Mode, third mode of the 2D Symbol Insertion tool. Select the Eyedropper Mode, click on a symbol and now that symbol is the active symbol. You are automatically returned to the Place Symbol Mode or Wall Insertion Mode, whichever was the mode you were in previously. Use of the U key to toggle this mode is clunky as it always returns you to the Wall Insertion (WI) mode. Since you have to toggle through the WI mode to get to the Pickup mode the WI then becomes the last mode you were in. This interface still needs some work, but if you click instead of toggle the mode buttons, it will save you from having to search through a long list of symbols in the Resource Browser if the symbol you want is sitting right in front of you in the drawing. Oddly, this mode is missing from the 3D Symbol Insertion tool. I haven't tried using the 2D Symbol Insertion tool (in Pickup mode) on 3D Symbols. It may work, so you might want to try it, but it suspect it won't snap to XY & Z. Still, it's worth a try. Raymond
  9. Thanks Pat, ???I've got it now. The Checkbox state is implied. When it's disabled the Layer Scale value is negative, although it doesn't show to be negative, just grayed. When it's enabled, the value is positive. Seems easy when you know the answer. SetPrefInt(540, -GetPrefInt(540)); will toggle the checkbox and retain the Layer Scale value. I'll add a note to my PDF and repost it. Raymond
  10. Hi Pat, ???Pref 540 is the field to the right of the preference I am looking for. It's a PrefInt. I am looking for the boolean pref number that controls the checkbox. I don't believe there currently is a number for that, based on a script I wrote that compares all pref values before and after an event, in this case, the manual toggling of that check box. Nothing changes when that checkbox is set or cleared. ???The same is true of the other two DPI values under the Resolution Tab, BUT, if you do find something that escaped me, please let me know and I'll update the PDF's. Thank you, Raymond PS - Don't spend too much time on it. I already compared every Integer, Longint and Real preference value from 0 to 32767. Not even a nibble.
  11. The short answer is - Upgrade. Interactive Settings, which include being able to set a ton of cursor and highlighting colors, were introduced in VW 2009. To adjust the "pickbox" size in VW 12, change the Snap Radius in VW Preferences > Edit Tab. it doesn't show any differently on the screen, but it does affect how close you need to be to snap. Raymond
  12. Here are two more annotated preference dialogs; VW Document Preferences and Unified View Options. The latter was posted in an adjacent thread but is also posted here to keep the bundle close knit. In the Document Preferences dialog, there are three items where I did not find a preference number, despite searching the entire list: ???Display Tab > Hide wall components when layer scale <= 1: _____ ???Resolution Tab > PDF Export (Quartz Only): _____ DPI ???Resolution Tab > Printing: _____ DPI Should anyone know how to read or write these values, please let me know. Raymond
  13. While we are all thinking, I think he wants Pref 95 (with a side of 102), but I say this having had the luxury of reading your thoughts. This script will toggle it: ???SetPref(95, not GetPref(95)); Raymond
  14. It is easy for the user to grasp and use, but it is difficult to implement. It would also slow the render and screen redraw times down a lot. Somewhere along the line, the computer is going to have to apply graduated transparency steps to the objects it draws. The smoother the effect, the more steps, just like the masking operation you were contemplating. Nice wish item, though. Photoshop might be the better tool at the moment. Raymond
  15. ???It is neither good, nor bad. Using VARs in each procedure keeps them local to that procedure. Declaring VARs once at the top of your program makes them global to all procedures. ???If you are only using a value within a procedure, then it is neater to make it a local variable, even if it has the same variable name in several procedures. If several procedures need to access the current value, then you can make it a global value, but bear in mind if one procedure changes the value another procedure cannot get the old value back. ???Another way to share values is to pass the variables into and out of a procedure using a parameter list. This is the best way to make your code readable to other users and to yourself later, as when you revisit it several years down the road. ???If your script is small, then it probably doesn't matter how you get it to work, but as it grows to the point where it spans several pages, then using a well structured approach pays off in spades. Raymond
  16. In VW 12, rotation of Rectangles and Ovals always creates a Polygons and Polylines, respectively. So, before you use the Offset tool, you are working with an approximation of the Oval made of Bezier segments. Rectangle and Oval rotation wasn't fully implemented until VW 13 (2008) Raymond
  17. Hello Richard, ???Short answer, Yes. The question becomes, "to what degree?" I have used VW for the last 20 years for circuit board design and similarly related graphical uses as it pertains to Integrated Circuit interface design. I've seen remarkable drawings of bridge designs, motorized vehicle designs and then of course there's the architectural side of it all. ???Though VW has hundreds of drawing tools, and hundreds more commands, I believe the most powerful facet of the software is the scripting language, VectorScript (and its evil twin, in the SDK). VS has over 1700 commands and provides the user with enormous options to use VW in yet to be defined ways. I cannot answer your NURBS question directly, but surely someone here will soon. ???We are practically neighbors. If you'd like to discuss this further, offline, I'd welcome the chance to talk about the strengths and limits of this software. You can either send me a PM or use the email address from my profile. Raymond
  18. I do. Thank you, Pat. I wanted to reference it in a post today and could find neither hide nor hair of it. Memory's the first thing to go. By the way, have you seen my car keys? Raymond
  19. It was here, at the top of the VS Forum for a long time - a post by Robert Anderson outlining the steps needed to install and run a VectorScript. Where did it go? I've searched the Techboard archives and the KnowledgeBase to no avail. Was it removed for a reason? Did it disappear inadvertently? Can we get it back? Raymond
  20. Charles, ???Not reading things as written is a penchant of mine. OK, I got it - finally. In the same vein, I don't know how many times I've answered a question that was never asked, only to reread the original post before sending and scrap my entire draft. The follow up answer is, almost always, very short. ???On the topic of using arrays, a few months back I used a dynamic array of handles to apply random attributes to objects. I was amazed how much faster it was compared to the same code that stepped through the list of handles with a WHILE loop and NextSObj(). For 10-30K objects the array method was MUCH faster. Everything has its place. Raymond
  21. Charles, you da' man! Charles is 100% right (except for me suggesting an array :-p ). When you move the PIO out of its container (the wall) there is no next object after the PIO, so you have to get the next node before you cut your lifeline. An array of PIO handles will work, too, but I think this way is easier. Procedure test; VAR h, hInternal, SaveMe : HANDLE; boo : BOOLEAN; Procedure doit(h:HANDLE); BEGIN IF (GetType(h) = 68) THEN BEGIN { WALL } hInternal := FIn3D(h); WHILE (hInternal <> NIL) DO BEGIN SaveMe := NextObj(hInternal); { look ahead before you cut your link } IF (GetType(hInternal) = 86) THEN BEGIN { PIO } boo := SetParent(hInternal, ActLayer); SymbolToGroup(hInternal, 0); END; { if } hInternal := SaveMe; { continue or reconnect } END; { while } END; { if } END; { doit } BEGIN ForEachObject(doit, ALL); END; Run(test); Raymond
  22. SymbolToGroup() doesn't work inside a wall, but it does if you move the PIO into the open, where it becomes a sitting duck. Try this: ???if SetParent(PIOhand, ActLayer) then ??????SymbolToGroup(PIOhand, 0); Raymond
  23. Have you tried SymbolToGroup(H, #)? Not sure if it will decompose a PIO, but it's worth a try. Raymond
  24. ????????Matter without density, now there's an interesting concept. VectorBub, ???You are right, so you should build your own. To add a fixed amount to a circle, you need to know its starting diameter. The ending diameter is the starting diameter + 2 * (radius increment). ???A nice way to implement this is by defining a function that accepts an increment and returns a scale factor; This is especially useful since your circles do have different diameters. function GetScaleFactor (H :Handle; RadiusInc :Real): Real; { Return the scale factor needed to change a circle's diameter by a fixed amount. } Var ???StartDiam, EndDiam :Real; ???X1, Y1, X2, Y2 :Real; Begin ???GetBBox(H, X1, Y1, X2, Y2); ???StartDiam := X2 - X1; ???EndDiam := StartDiam + 2 * RadiusInc; ???GetScaleFactor := EndDiam / StartDiam; End; { GetScaleFactor } ???To use it, you already have the center XY from hCenter: hCenter (H, X, Y); ScaleF := GetScaleFactor (H, 2mm); hScale2D (H, X, Y, ScaleF, ScaleF, False); ???Watch your units. Other than that, this will work every time. Raymond
  25. Hi Pat, ???hScale2D - born on version - VW 10 ???hScale3D - born on version - VW 12 I recently went through the VS Func Refs and the "backwater documentation*" to determine when things appeared (and disappeared). This was a little OC on my part, but good info if you really want to know. Raymond * VWPluginLibraryRoutines.p, in the user's plugin folder.
×
×
  • Create New...