Jump to content

MullinRJ

Member
  • Posts

    2,004
  • Joined

  • Last visited

Everything posted by MullinRJ

  1. Let's not get carried away with wild wishes, please. Dimensions are just another object and should be treated as such. If it's desired to have them in front, create a layer for them in front of your model and dimension away. It's not at all cumbersome. This is a situation where personal discipline should be employed instead of relying on the autocratic software approach to standardized draughting enforcement. If the idea of using a separate layer really is too burdensome, a simple custom scrip should suffice. Try: DSelectAll; SelectObj(T=DIMENSION); MoveFront; Raymond
  2. Do you mean when CopyOver returns, or when LibHasIDLabel returns, or the whole PIO procedure? If you mean CopyOver, I think Charles is right, it is a problem of the variables' scope. Each time you leave the function CopyOver, you should expect all your locally declared variable data to be invalid. The fact that Stings don't is an abnormality, not the norm. To get the values to stick each time you enter CopyOver, declare the following as global variables and not local: gdestPIOType, gsrcPIORecName, gdestPIORecName, gsrcPIOIDLabel, gdestPIOIDLabel: DYNARRAY[] OF CHAR; You can use the global variables locally, but I would add them to the calling chain to keep it neat and tidy, as: FUNCTION CopyOver (theDestPIO: HANDLE; VAR destPIOType, srcPIORecName, destPIORecName, srcPIOIDLabel, destPIOIDLabel: DYNARRAY[] OF CHAR): BOOLEAN; As for allocating variable space before it is used it, I always do, except when reading from files. If your first assignment allocates what you need, you should not expect to be able to add more to a text variable unless you allocate additional space for it. You can always shorten the character data, though. If your data is shorter than 255 characters, why not use Strings and forget about all the hassles of allocation. Raymond
  3. If you intend to query layer types a lot, perhaps adding a simple function to your code will make things more readable. I have one here: function isSheetLayer(LyrHnd :Handle) :Boolean; { Returns TRUE if LyrHnd points to a Sheet Layer, FALSE otherwise. } Var X, Y :Real; Begin isSheetLayer := GetSheetLayerUserOrigin(LyrHnd, X, Y); End; { isSheetLayer } HTH, Raymond
  4. Hi Ben, You can test layer handles with GetSheetLayerUserOrigin(). Raymond Procedure test; VAR H :Handle; X, Y :Real; BEGIN H := FLayer; while (H<>nil) do begin if GetSheetLayerUserOrigin(H, X, Y) then Message(GetLName(H), ' - SheetLayer') else Message(GetLName(H), ' - DesignLayer'); Wait(1); H := NextObj(H); end; { while } SysBeep; END; Run(test);
  5. What about using ForEachObject() or ForEachObjectInLayer()? They do the work of nested WHILE/DO constructs and have a lot of flexibility, to boot. Raymond
  6. Hi Charles, There's always another way. It's not necessarily better, just different. In this case, I'd opt for a temporary layer and do my flipping there, using SetParent to move it back and forth. I only mentioned working in a group or a symbol to show possibility, not preference. If stacking order is an issue (as it often is) I also remember where it is in the stack and push it back when done, which can be done by remembering an adjacent handle. To work inside groups I use FIn3D (FInGroup also works) to get a handle to an object inside, then navigate from there. The list inside the group is self-contained, so it's no different from working on any layer with handles. I don't typically enter a group with DoMenuTextByName (aka DMTBN), but if I want to display the contents of the group, I think using DMTBN then RedrawAll is the only way. Raymond
  7. If you don't want to mess around with arrays, you can move the object into a temporary container (symbol / group / layer) with SetParent and flip it there, then move it back and delete the container (or leave it if you intend to use it again). Raymond
  8. In all the years I've programmed with Pascal, I've never had to use a GOTO. If you learned to program with BASIC it may be ingrained in the way you think about programming, but it's definitely not necessary. If you want to lose the GOTO's, post more and I or someone will help you kick the habit. If they don't bother you, we won't tell Dijkstra. ;-) Raymond
  9. No, you can have statements after the function's return value is assigned, or have several exit points in the function where an appropriate value is assigned. eg. : function abc(X, Y :Real) :Integer; Begin abc := 0; if X>Y then abc := 1 else if Y>X then abc := 2 else if (X<1) or (Y<0) then abc := -1; End; Raymond
  10. Is the symbol the Property line now resides in a 2D or 3D symbol? Are you mixing 2D and 3D parts? Raymond
  11. For a simple conic section, which is what I believe you described, to describe the flattened shape you need to know the radii of 2 arcs that correspond to the top and bottom edges of your sign. The reference point you are looking for is the apex (or nadir in this case) of the cone your sign is wrapped around. I drew the arc you described with a chord of 101" on a radius of 55", which comes out to a sweep of ~133.3234? and an arc length of 127.98129". When you extrude this at a taper of 30? to a height of 6", then extend the sides to a vertex, you get a distance of 110.00" to the narrow edge (bottom edge, the one you specified) and ~116.93" to the wide edge (at the top, extruded edge). To flatten this pattern, draw two arcs with a common center: 1) radius = 110.00" and Arc Length = 127.98" (This works out to a Sweep of 66.6617?), 2) radius = 117.30" and Arc Length = 136.47". Connect the two arc ends with lines and Compose the 2 arcs and 2 lines to get the flattened pattern you were looking for. HTH, Raymond
  12. azizg, Though VW doesn't handle Rotated Rectangles at the moment, it is currently possible to edit polygons in a rectangular pattern as you would Rectangles (by length and width). Additionally, you can edit the angle of rotation and anchor any vertex, any midpoint on a side, or the center. This also includes Polylines in a rectangular pattern. To do this, you need to add my Reshaper PlugIn to your bag of tools. If you'd like to try an evaluation copy for a month, please drop me a line with the last 6 digits of you VW serial number and I will send you a Demo version and a KEY to unlock all its features. In addition to editing Rotated Rectangles, you will gain access to dozens of object parameters that are inaccessible through the OIP. As for your second question, Reshaper won't help you there, but you're not the only one waiting for this magical feature. Raymond mullinrj@aol.com
  13. I've never seen the behavior you describe, but that is a better description. It may be machine related. How about more stats? Machine (and speed) / RAM / VW product & version? Externals? (i.e., Mouse? Tablet?, Monitor, card, driver?) Raymond VW D/RW 12.5.2(69163) / Mac mini 1.8GHz / 2GB RAM / OS 10.4.8
  14. Hi Gideon, Leaving that preference ON will noticeably slow down all PIO scripts, especially the big ones. When developing PIO scripts I leave it on all the time, and toggle it off when I want to see how a script will perform in reality. Under normal operating scenarios I leave it OFF. Raymond
  15. But the beauty of scripting is you only have to type it once. If you want to be able to use the code in your script to draw several lines, define a procedure with the code and call it once per line you want to draw. procedure LinePolar(X, Y, L, A :Real); { Draw a Line from point (X, Y) to another point specified by length L and angle A (in degrees). } Begin A := Deg2Rad(A); { change A to radians } MoveTo(X, Y); { Move to first point } LineTo(X+L*cos(A), Y+L*sin(A)); { Draw to second point } End; { LinePolar } Instesd of MoveTo(); and LineTo(); calls to draw a line, use: LinePolar(1, 2, 5, 53.1301); which is the same as: MoveTo(1, 2); LineTo(4, 6); The same could be done for LineToPolar(), which you may want to use if you are chaining segments together. Let me know, or try your hand at it. It's not hard. Though, if that's the case, you probably should be using Polygons. HTH, Raymond
  16. WooHoo! You guys ROCK! Thanks millions, Raymond
  17. Hi Gideon, You have to convert your distance and angle to X & Y displacement, but it can be done with a few lines of code. MoveTo(X, Y); { Draw first point } A := Deg2Rad(A); dX := L * cos(A); dY := L * sin(A); LineTo(X+dX, Y+dY); { Draw last point } where L = Length, and A = Angle in degrees. You can also do it with vector math, but it's pretty much the same approach. Raymond
  18. There used to be a day when sending an email to BugSubmit@... elicited an automated response. That was a nicety I wish you would reinstate. Even as minor feedback, at least it indicates you receive the post. Without it, I feel less inclined to send bug reports. Apathy needs little nurturing. If you want them, I can use all the help you can afford. Thank you, Raymond
  19. There used to be a day when sending an email to BugSubmit@... elicited an automated response. That was a nicety I wish you would reinstate. Even as minor feedback, at least it indicated you received the post. Without it, I feel less inclined to send bug reports. Apathy needs little nurturing. If you want them, I can use all the help you can afford. Thank you, Raymond PS - This is really a Wish List item. I'll repost there, too.
  20. I don't know if this will work, but try adding: ResetObject(h); after your last "SetRField();" statement. HTH, Raymond
  21. You can change the Default.sta file to have the accuracy and settings you want for new files. Set up a blank document with everything the way you like and save it to \Templates\Default.sta in the VW application folder and replace the existing file. You can even include scripts, symbols and objects if you like. HTH, Raymond
  22. Are you on a PC? If so, you have to know where to place the cursor at the end of the line where a shortcut key would display (if it were there), click and highlight an invisible text entry box, then enter your key choice. Simple, huh? If you're on a Mac, with the menu command highlighted, just type the key choice and it magically appears where it should. HTH, Raymond
  23. That will get you part of the way where Reshaper will take you, but it only addresses the annoyance part of typing in the OIP. You still only get to see the same fields you see in the OIP, not the plethora of extra attributes accessible with Reshaper. And there's NO Rotated Rectangle support anywhere in VW (yet) - just in case you wanted to compare your apples to my apples. ;-) Raymond
×
×
  • Create New...