Jump to content

WhoCanDo

Member
  • Posts

    402
  • Joined

  • Last visited

Posts posted by WhoCanDo

  1. Hi Pat,

     

    There are not instances of FirstWkSht on the drawing since it's a list of material to cut and therefore has a total length and total weight listed. I want the weight listed on the second worksheet but the format of the second worksheet means that the link is on the database line of a different database item.

     

    So the first worksheet, line 56, is database criteria =DATABASE((R IN ['Kickplate'])) with the cell C56 containing =(Product.Weight) ..... the answer is 9.38 kg

    The second worksheet, line 5, is database criteria =DATABASE((R IN ['A/Panel'])) with the cell G5 containing =('FirstWkSht':C56) ...... the link shows 18.76 kg

     

    I tried to divide the link answer by COUNT(R IN ['A/Panel']) but that gave an answer of 2, however if I put =COUNT(R IN ['A/Panel']) in a "spreedsheet" cell (say E14) then divide the link answer by that spreedsheet cell, it does work. eg. =('FirstWkSht':C56)/E14

     

    The thing is, I don't want a line of unrelated numbers showing up, and even though I could hide this line, I shouldn't have too.

     

    Can you see a fault in my formulas?

     

  2. Now this has caused a different problem.

     

    On the first worksheet I have in cell C56, =(Product.Weight), which for 8 objects displays 9.38 kg correctly.

     

    On the second worksheet I have =(FirstWkSht:C56) with the result 18.76 kg.

     

    The link to the first worksheet is on a database defined "Item" line that is not the same database as C56 "Product" and has 2 items listed.

     

    So, the weight on the first worksheet is correct, but when reflected on the second worksheet, the reflected value is multiplied by the record count on that line.

     

    =(FirstWkSht:C56)/Count(R in ['Item']) doesn't work

     

    Is there a solution to this?

     

  3. It's been like this for years and only recently stopped working.

     

    I can see your point, so that means that VW has ignored the RecalculateWS (h) for years rather than running indefinitely and chosen to run indefinitely.

     

    This maybe the fix but it counts 106 instead of the expected 15 worksheets. I'd like to know why if anyone can help.

     

    h := FInGroup (GetParent (GetObject ('Banding Cutting List')));
    p := 0;
    while (h <> NIL) do
      begin
      p := p + 1;
      if (GetTypeN (h) = 18) then
        RecalculateWS (h);
      h := NextObj (h);
      end;
    Message (p);

     

  4. Can anyone suggest why this has stopped working for me. The script just looks until I press ESC but it use to work for years.

     

    h := FInGroup (GetParent (GetObject ('Banding Cutting List')));
    while h <> NIL do
      if (GetTypeN (h) = 18) then
        RecalculateWS (h);

    The worksheet "Banding Cutting List" exists in the sub-folder Worksheets in the Resource Browser. There are only 15 worksheets in this folder and yet the integer loop counter I tested just kept going past it's positive limits.

     

    I must be missing something here.

     

     

  5. Chrissy,

    How did you get this to work?

    I added SetTextSize (h, 0, 99, GetTextSize (h, 1) / GetLScale (ActLayer) * 25); after the message.

    This changes the text visually on the screen, but not really. If you cut and past the dimension, it shows the original text size.

    I think we want the same thing for different reasons.

    I've written a macro to change all layers of the same scale as the active layer to a new asked scale. The problem is the text doesn't stay the same point size after the layer changes scale and the code that Raymond wrote (with my addition above)  changes the text only visually.

     

  6. Hi,

    Anyone had problems with Unified View?

    We usually draw with if off but if I switch in and out of OpenGL (I think) it seems to switch the other layers to 3D as if Unified View was active.

    The other layers usually switch to Top View rather than Top/Plan.

    Any ideas why this would happen when Unified View is not selected?

    Is there a keyboard shortcut that I may be using without realising it?

  7. Hi,

    Since loading a trial licence to test a problem for the VW techs, my dialog boxes open inconsistently in the top left corner of my screen.

    "Inconsistently" because the same dialog can pop up in the middle of the screen (where it should be) the next time.

    How can I stop the dialogs from my macros & VW (like "move") from poping up anywhere else but the middle where it should do?

    Even after changing the serial number back to my purchased number, it still happens.

  8. Thanks Raymond,

    Something in you code is ReverseWallSides(h); but when I minimize it, it works fine. Thanks

    PROCEDURE Main;
    { St. Patrick's Day 2016 - Raymond Mullin }
    VAR
    h : HANDLE;
    StartAng, SweepAng, ArcRadius : REAL;
    P1, P2 : VECTOR;	{ ARC Start and Stop points respectively }
    Pcen, Pmid : VECTOR;	{ ARC Center and Mid points }
    
    BEGIN
    h := FSActLayer;
    if (h <> nil) then
    BEGIN
    { Get arc data }
    GetSegPt1 (h, P1.x, P1.y);	{ start point }
    GetSegPt2 (h, P2.x, P2.y);	{ stop point }
    hCenter (h, Pcen.x, Pcen.y);	{ center point }
    GetArc (h, StartAng, SweepAng);
    ArcRadius := Distance (Pcen.x, Pcen.y, P1.x, P1.y);
    Pmid := Pcen + Ang2Vec (StartAng+SweepAng/2, Distance (Pcen.x, Pcen.y, P1.x, P1.y));
    DSelectAll;
    Locus(Pmid.x, Pmid.y);
    END; { if }
    END;
    RUN (Main);
    

  9. Hi, I always have problems understanding vectors so a little help would be appreciated.

    If I draw a round wall, I would like to find the vector point on the center-line of half the arc length.

    I can find the radius "Distance (P2.x, P2.y, P3.x, P3.y)" and the angle "SweepAng/2" but how do I get the new vector P4 ..

    PROCEDURE Main;

    VAR

    h : HANDLE;

    StartAng, SweepAng, ArcRadius : REAL;

    P1, P2, P3, P4 : VECTOR;

    BEGIN

    h := FSObject (ActLayer);

    GetSegPt1 (h, P1.x, P1.y);

    hCenter (h, P2.x, P2.y);

    GetSegPt2 (h, P3.x, P3.y);

    GetArc (h, StartAng, SweepAng);

    ArcRadius := Distance (P2.x, P2.y, P3.x, P3.y);

    Message (StartAng, ' ', SweepAng, ' ', ArcRadius);

    P4 := Ang2Vec (SweepAng/2, Distance (P2.x, P2.y, P3.x, P3.y));

    DSelectAll;

    h := PickObject (P4.x, P4.y);

    END;

    RUN (Main);

×
×
  • Create New...