Jump to content

MullinRJ

Member
  • Posts

    1,990
  • Joined

  • Last visited

Everything posted by MullinRJ

  1. Hi Dexie, A very easy fix. Raymond Procedure RenameClasses; { Add "OS-" to the front of classes that begin with "G80". } CONST Prefix = 'G80'; VAR ClassName, NewName :STRING; i :INTEGER; BEGIN i := 1; REPEAT ClassName:= ClassList(i); if (pos(Prefix, ClassName) = 1) then begin { only do next 2 lines if condition is met } NewName:= Concat( 'OS-', ClassName ); RenameClass ( ClassName, NewName ); end; i:=i+1; UNTIL i = (ClassNum+1); Sysbeep; AlrtDialog('Renaming classes is complete!'); END; Run (RenameClasses);
  2. Hi Andreas, Always happy to help. Yes, ArcTo does continue the straight line segment from the last point. One thing to note, ClosePoly and its converse OpenPoly stay in effect until changed, so you don't need one for each BeginPoly. Also, it is a good practice for most Polylines to start and end with Corner Points - MoveTo and LineTo. For Open Polylines, it's always necessary. Raymond
  3. Your Polygon can also be written as: ClosePoly; { if you want it closed, recommded } BeginPoly; MoveTo(0, 0); LineTo(W, 0); LineTo(W, Tf); LineTo(Tw, Tf); LineTo(Tw, H-Tf); LineTo(W, H-Tf); LineTo(W, H); LineTo(0, H); LineTo(0, 0); { optional } EndPoly; If you want to fillet the two inside corners: ClosePoly; BeginPoly; MoveTo(0, 0); LineTo(W, 0); LineTo(W, Tf); ArcTo(Tw, Tf, 5); ArcTo(Tw, H-Tf, 5); LineTo(W, H-Tf); LineTo(W, H); LineTo(0, H); LineTo(0, 0); { optional } EndPoly; For examples in coding, goto VectorDepot (www.VectorDepot.com) HTH, Raymond
  4. Small typo. The VS command I was referring to is called UnitVec, not Unit. Raymond
  5. Cmd-Opt-1 & Cmd-Opt-2 are set to zoom in and out by a factor of 4, respectively. I assigned them to Unlock and Lock. Interestingly, when items are selected, they lock and unlock as I would wish, but when nothing is selected the zoom x 4 takes effect. I like this duality. i never expected it to work for Lock/Unlock, but it was worth a try. I hope someone else finds this useful. I've been using it since VW10. Raymond VW 12.0.1 D/RW G4 / OS 10.3.9
  6. Funny you should ask. The same question was posted on the VS List last week. This was my answer then, and I'm sticking to it. Raymond
  7. Hi Peter, You're welcome. Sorry about the dangling H. I had "H := LNewObj;" in there earlier then opted to lose the assignment for the following. It should read: DelObject(LNewObj); Either way works. I tend toward minimalism whenever it is convenient. The forumlae are really expanded versions of U x V or CrossProduct(U, V) where U and V are defined from the three points P1, P2 & P3. By using the expanded versions I forego calculating U, V & W. But if you want to try it, declare P1, P2 & P3 as type Vector instead of type Point along with vectors U, V & W. The answer for crosproduct in 2D math is always in the Z direction or the returned vector. If the Z component is positive the rotation is CCW; if it's negative, CW; if it's zero, then collinear. The magnitude is unimportant in this case. VAR P1, P2, P3, U, V, W :Vector; ... function InARow (P1, P2, P3: Vector): Boolean; ... function RotateCCW (P1, P2, P3: Vector): Boolean; ... { longhand } U := P2 - P1; V := P3 - P1; W := crossproduct(U, V); { or minimally } W := crossproduct(P2-P1, P3-P1); { the answer } message(W.z); { test Z component for +, -, or 0 } To answer your question, "Are there any other Vector formulas I should be aware of?", the short answer is YES. It would be difficult to give a rough overview of the field. Suffice it to say that all computer graphics are based on vectors and matrices. The obvious recommendation is to also become familiar with Unit, Norm and DotProduct. Unit scales a vector to length of 1, and Norm returns the length of a vector (it's always positive). So, Norm(Unit(V)) is always 1 (unless V has zero length). DotProduct can be used to indicate if two lines/vectors are parallel or perpendicular. if (DotProduct(Unit(U), Unit(V) = 1) then { U & V are parallel } if (DotProduct(Unit(U), Unit(V) = 0) then { U & V are perpendicular } If you have a more specific question in the future it may be easier to answer. Glad I could help, Raymond
  8. Easier to understand, or easier to implement? I think the angle way may be easier to understand, but harder to implement when you cross the ?180? boundary. Even with positive degrees/radians, there is a 0/360?, or 0/2Pi boundary to contend with. I prefer to use vectors and the cross product to determine 2D rotation. It may not be easier to understand, but it is easier to implement, especially with the following code. Enjoy, Raymond procedure XProd; { Show whether a user-selected Point is to the Right or Left of a user-drawn Line. } { Your vantage point is standing at point P1 and looking at point P2. } VAR P1, P2, P3 :Point; function InARow (P1, P2, P3: Point): Boolean; { Returns TRUE if the angle from line P1-P2 to point P3 is collinear. } Begin InARow := ((P1.x - P2.x) * (P3.y - P2.y) - (P3.x - P2.x) * (P1.y - P2.y)) = 0; End; { InARow } function RotateCCW (P1, P2, P3: Point): Boolean; { Returns TRUE if the angle from line P1-P2 to point P3 is CCW. } Begin RotateCCW := ((P1.x - P2.x) * (P3.y - P2.y) - (P3.x - P2.x) * (P1.y - P2.y)) < 0; End; { RotateCCW } BEGIN {Interactively draw a line and display it. } GetLine(P1.x, P1.y, P2.x, P2.y); MoveTo(P1.x, P1.y); LineTo(P2.x, P2.y); Redraw; { Get a point to compare to the line. } GetPt(P3.x, P3.y); { Herald in the answer and display it for all to see! } SysBeep; if InARow(P1, P2, P3) then AlrtDialog('You clicked ON the line.') else if RotateCCW (P1, P2, P3) then AlrtDialog('You clicked on the LEFT side of the line.') else AlrtDialog('You clicked on the RIGHT side of the line'); { Clean up - throw away the line. } DelObject(H); END; RUN(XProd);
  9. Hi Michelle, To resize groups, make sure your view is set to Top/Plan. If you are in any 3D view then your group resizing ability disappears, unless you have a small utility called Reshaper. Raymond
  10. At the bottom of each discussion area (the page above this one, where you read the list of posts) there is a popup menu on the left marked: Show "active within the last x days/weeks/months/year" Change it to "from all dates", then press the CHANGE button. You will see a lot more pages to choose from. You will also have to set this option in each discussion area as needed. HTH, Raymond
  11. I don't believe you can import the text as TEXT, and retain the formatting. If you just want to be able to read the text on a VW page, you can create a PDF of the Word document and import that graphic using: File>Import>Import Image File... Raymond
  12. Hi Pete, You can change the name in the Data Pane of the OIP, like any other named object. Raymond
  13. The difference is that older versions of VW place the handle slightly inside the end of the line, where VW12 places the handle directly ON the line's endpoint. The older versions will often show two handles for touching endpoints, where VW12 will never show two handles for touching endpoints. BUT, for concurrent handles, the older software only showed a handle for odd numbers of endpoints, and no handle for even numbers. VW12 always shows a handle. That's an improvement. I liked the placement of the handles in the older software better, but the bigger handles in the new software are easier to see. The bigger handles eat up more screen area, and obscure object detail in a drawing when many objects have selected points within a small area. With overlapping handles the drawing is easier to see. It's a trade off. If you want big handles to see them more easily then you will have to live with overlapping handles. If you want separate handles, you will have to live with smaller handles. Tough call. Perhaps we could get a highlight option that was controlled by a modifier key press - Cntl-Option or Shift-Option when pressed would temporarily color or thicken selected objects. It would be nice, but I can live happily with the program just the way it is ... or was. Raymond
  14. I hide VW often, using both Cmd-H and Option-Click on another app. My Mac sleeps often. And I click in the dock or double click the file in the Finder to awaken VW. It has never caused a problem, so I should think these are OK things to do. That being said, I am running on a G4 and OSX 10.3.9, so it could be a hardware or OS issue. But if nobody else is having your problem with your combination of HW & OS, I wouldn't start looking there initially. Good luck, Raymond
  15. Hi Ben, Regarding your first question: There is a 32K limit on scripts that are run from script palettes. There is no such limit for scripts that are executed from PIOs (menu commands), or scripts that are referenced via the $Include comment. It must be a VS Editor limit, not a compiler limit. Use the $Include comment as the first (and only) line of your script in the VS. It references a file that contains the rest of your script. You may also use $Include many times in your files. I don't know of a limit there, or more accurately, I haven't reached it yet and I have used over 50 in my Reshaper program and it is over 250K. It normally runs from a PIO, but I just tried it from a script palette and it works there, too. Here's an example of a script calling a larger script file: {$Include \Drive name\VW Cmds\Project 1\Test File.px } There's only one line in the VS, which references the file "Test File.px". You can use the editor of your choice, as long as it's not the VS Editor. The \ delimeter works on both Mac and PC. Be sure to set Tools > Scripts > VS Compiler Mode to compile EACH time, or it will cache your program the first time it is run and no changes you make in your editor will take effect until you close and reopen the VW file. When you are done debugging your script, set the mode back to FIRST time, and things will speed up. HTH, Raymond
  16. Everyone has their own way. Hopefully one of these will suit your needs. Here's mine. I keep a grid layer in all of my files that I toggle on and off with a script. The script can reside in a Script Palette or with a little more work, exist as a menu command assigned to a hot key. I toggle the layer uncountable times during a design and always off for printing. Anything can be placed on the layer and none of it prints. Oh, I also keep this layer behind everything so it's out of the way and doesn't interfere with selecting objects. HTH, Raymond Here's the script: procedure ToggleGrid; CONST GridLyr = 'Grid'; { your grid layer name } VAR LName :String; BEGIN LName := GetLName(ActLayer); Layer(GridLyr); if (GetLVis(ActLayer)=0) then HideLayer else ShowLayer; Layer(LName); END; Run(ToggleGrid);
  17. Short answer, Yes. Pick an object or objects. Goto Modify > Scale Objects... You must have an object selected to use the Scale Entire Drawing checkbox. Check it. Enter 9/7.355 in the top box and press Enter. You don't even have to do the math beforehand, VW will do the division for you. You've probably gone through Jonathan's podcast by now, but if you have to come back here, you won't have to browse any further. Raymond
  18. Move Command For the fields that do have keyboard shortcuts, two of them are bad choices. Cmd-X = CUT and Cmd-A = Select All. The dialog never receives these events on the Mac as other software grabs them first. Actually, none of the Cmd keys in this dialog takes you to a field. I, too, would like keyboard shortcuts for Cartesian and Polar. Preferably under the left hand. How about Cmd-R for Polar and Cmd T for Cartesian. Good luck finding a substitute for X. If you could assign independent keys to fields, you could use Cmd-1 for X and Cmd-2 for Y (easy to reach), but alas, that won't fit the Windows interface. Raymond VW 12.0.1 D/RW OS 10.3.9
  19. No, Groups are objects like any other and must reside on a single layer. You can use Move... or Move 3D... on all the selected components (without grouping) if you change the Layer Options to "Show/Snap/Modify Others". Don't forget to change it back when done. HTH, Raymond
  20. Hi Katie, With the Zoom Tool (C key), I click once in the drawing in Marquee Mode. The drawing will zoom in by 2X (or out with Option-Click) and the point where I click stays anchored on the screen. I have no problem with the way it operates, but I would like an additional mode where that point also gets centered after the zoom is applied. Adobe Acrobat's zoom tool works that way with a single click. Photoshop does too. Thanks, Raymond
  21. When using the Zoom tool with a single click, VW zooms the drawing about the click point and that point in the drawing stays anchored on the screen. I would like another mode that also centers the drawing on the click point after a single zoom click. I know if I want to move a point on the right side of the screen toward the center, I can option-click the drawing on the left side and achieve roughly what I'm after, but I find it counter intuitive to click away from the area of interest. An additional zoom mode would make me happy. Raymond
  22. MullinRJ

    include files

    Use the Windows addressing format, even if you are on a Mac. {$Include filename } { implied to be in the Plug-Ins folder } {$Include \Drive Name\folder\file name } { anywhere on your system } If you can be more specific, someone can offer more help. Raymond
  23. Yes, it's not enough to change the view while inside the Symbol Edit mode. You have to ENTER the symbol in the view you wish it displayed in the RB. Personally, I'd like to have the RB icon built from the view I am in when I EXIT the Symbol Edit mode. Raymond
  24. I think what you should both be looking for is someone to PAY your taxes, then you can easily afford to hire someone to file them for you. FWIW, Raymond :-p
×
×
  • Create New...