Jump to content

MullinRJ

Member
  • Posts

    2,024
  • Joined

  • Last visited

Posts posted by MullinRJ

  1. 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. [Cool]

  2. 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

  3. 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

  4. 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

  5. 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

  6. 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

  7. 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

  8. 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

  9. 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

  10. 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 ]

  11. Tom,

    Do you set the font face from within your script? I have seen PIO's accept color, font face and size changes by selecting the PIO and using menu options to apply them, but you may have a problem if your script sets them explicitly.

    Also, what properties are set for the PIO? The one I examined had the RESET button highlighted with no checkboxes selected.

    Raymond

  12. I'm not sure about your first question.

    You can change OIP values from within a PIO, but the code has to finish executing to see its effect.

    When the PIO code starts, the OIP values are copied to memory and essentially become constants for that iteration of the code. New values can be written to the record where the OIP stores information, but they will not be reflected in the OIP window until after the script stops. Depending on how you write your script, this may or may not be an issue.

    I played for a day with a script that wrote data to the OIP until I figured out the interaction and the sequence of events. I was able to get what I wanted, but it was anything but easy.

    To write to a PopUp menu in the OIP, you just need to set it to one of the choices already in the menu.

    Use:

    SetRField(objHand, objName, 'PopUpFieldName', 'yourPopUpValue');

    to set the value.

    You can get the objHand and objName values from:

    GetCustomObjectInfo(objName, objHand, recHand, wallHand);

    "objName" is the PIO name AND the name of the record that defines the PIO values, as you might hope it would be.

    I'd write more, but I'd only be guessing at what I think you might want to know. If you can be a little more specific, I, or someone else on this board can tell you a whole lot more.

    HTH,

    Raymond

    [ 10-09-2004, 03:06 AM: Message edited by: MullinRJ ]

  13. Hello again Chrissy,

    As I rode my horse around the pasture today, in the last light of the setting sun (a national pastime in Texas), I gained some more clarity to your problem. If you don't want to use the DMTBN approach, the following procedure will find all the text objects in a dimension object, regardless of how they are nested in groups. Actually, the code will work for any nested group of objects, not just dimensions. I leave it to you to do with them as you will.

    I always enjoy writing recrusive routines, perhaps because I don't get to use them much. So, here's one that was fun to write.

    code:

    procedure xxx;

    { Get the handles to all text objects within a dimension object. }

    { Author : Raymond J Mullin - ?2004 All rights reserved. }

    CONST

    TextType = 10;

    GroupType = 11;

    VAR

    H :Handle;

    procedure FindTxtObj(H :Handle);

    { Receive a handle to a container object. Step in, and look for Text objects. }

    Begin

    H := FIn3D(H);

    while (H<>nil) do begin

    case GetType(H) of

    TextType: begin { Do stuff to text here }

    Message(H, ' ', GetType(H), ' ', GetText(H));

    Wait(1);

    end;

    GroupType: FindTxtObj(H); { Re-enter this procedure and search the new group. }

    end; { case }

    H := NextObj(H);

    end; { while }

    End; { FindTxtObj }

    BEGIN

    ClrMessage;

    H := FSActLayer; { Handle to Dimension Object }

    FindTxtObj(H);

    Sysbeep;

    END;

    Run(xxx);
    [/code]

  14. Hi Chrissy,

    Depending on the level of control you desire, there are two ways I know of to do what you ask.

    The easiest is to use DoMenuTextByName. If you can use one of the point sizes in the menu, just put it's menu index in the following call.

    DoMenuTextbyName('Font Size', 4); { 12 points }

    For more complicated processing, you can get a handle to the text element of a dimension object using something similar to the following:

    code:

    procedure xxx;

    CONST

    TextType = 10;

    GroupType = 11;

    VAR

    H :Handle;

    BEGIN

    H := FIn3D(FSActLayer);

    while ((H<>nil) & (GetType(H)<>TextType)) do begin

    if (GetType(H)=GroupType) then H := FIn3D(H) { Text is grouped, don't know why }

    else H := NextObj(H);

    end;

    if (H<>nil) then begin

    Message(H, ' ', GetType(H));

    { You have a handle to the text part of the Dimension }

    { insert your code here }

    end;

    END;

    Run(xxx);
    [/code]

    Have fun,

    Raymond

  15. Well, as is usually the case, confusion clears as I walk away from a problem. I was confused as to why text was grouped inside a dimension object, but I was only thinking of the single numeric object that represents the dimension length.

    In a simple dimension, there is only one text object within the dimension object, the length of the dimension. It seemed unnecessary to group it. However, dimensions can be made more complicated by adding tolerances, leaders and/or trailers in the OIP. Each of these text objects can also be found inside the group within the dimension object, if they exist.

    So, once you have a handle to the first text object within a dimension object, you may have to search for additional text objects to format. The number of text objects can be determined by the setttings in the OIP that control the dimension object. I hope this makes sense to you.

    Have fun,

    Raymond

  16. I have never found a use in my work for placing a script in a View, except for running a quick and dirty one time script without creating another VS routine on a palette.

    Just because something is available, doesn't mean it needs to be used. The original question asks, "Why is this useful?" Patrick may have some appropriate applications, but for the most part, it's not an integral facet of VW. However, it is a nice feature if you can find a use for it.

    Raymond

  17. Your questions are valid, but I don't believe they are documented. I think they would best be answered by attempting explicit examples.

    quote:

    ...would you add a stand alone script with its own set of variables, begin, end, and run, statements?

    Yes, unless you don't use any variables. Then you can just have some statements without Begin, End and Run. Treat it as a normal script.

    quote:

    Would the added script execute before or after the actual edit sheet script?

    Before. I just tried a quick example.

    quote:

    If you add something contradictory to the edit sheet script itself, would it replace that item in the script, would it generate a VectorScript error, or would it just ignore it?


    When you say contradictory, what did you have in mind?

    Raymond

  18. Sorry Patrick, I just now saw your post or I would have replied sooner. I too am sitting on the bench waiting for a definitive need to get started. Most everything I have wanted to do can be done in VS, except the little mode icons that appear in the display bar of well polished tools. Give me a good reason and I'll join you. Most likely, two can work better than one. Nudge, nudge.

    Raymond

×
×
  • Create New...