Jump to content

WhoCanDo

Member
  • Posts

    462
  • Joined

  • Last visited

Everything posted by WhoCanDo

  1. The experimenting I've got it. =('Worksheet Name':I16) However, does Nemetschek have any help for worksheet formula/help?
  2. There doesn't seem to be a specific worksheet discussion page so can someone let me know how to =(another worksheet.cell reference) please. Does Nemetschek have any help for worksheet formula/help?
  3. 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);
  4. One option I have used is to set the units as you want them in a blank sheet and then export the script and see what you get. I used Excel to compare two scripts by pasting each into columns A & B and then by using the code.. =IF(A2=B2,"",1) in column C (dragged down)
  5. Thanks to all that viewed my question. The answer is.. P4.x := P2.x + ArcRadius * Cos (Deg2Rad (SweepAng/2)); P4.y := P2.y + ArcRadius * Sin (Deg2Rad (SweepAng/2));
  6. 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);
  7. Hi, SetPrefReal (70, ???); sets the print area scale. How do I change the print area orientation from Portrait to Landscape and back again? Regards
  8. Thanks Mike, I'm not ungrouping anything in the macro so I guess this is similar to VW2014 "Do you wish to attach the record to everything within the group" Thanks, I'll choose No then. Regards
  9. A warning popped up when my macro is trying to a single record to a group of rectangles "attach group records to the resultant ungrouped objects" Can anyone give me an idea to what this means please? Yes & No seem to produce nothing different to what I want so why did it ask? Thanks
  10. Good job Tui, HMove(hW1, BorderWdth/2 - HWidth (hW1), BorderHght/2) works a treat. Regards
  11. With much hope I tried the idea twk but alas to no avail. GetWSPlacement is another non-operational function. procedure test; var hW1 : handle; t1, l1, b1, r1 : real; begin hW1 := CreateWS ('testWS', 5, 5); hW1 := CreateWSImage (GetObject ('testWS'), 0, 0); GetWSPlacement (hW1, t1, l1, b1, r1); Message (t1, ' ', l1, ' ', b1, ' ', r1); SelectObj ((T = 56)); Relative; MoveObjs (l1 - r1, 100, false, false); Absolute; end; run (test);
  12. I placed a worksheet on my drawing using .. hW := CreateWSImage (GetObject ('Schedule'), 0, 0); I would like to place it as follows .. hW := CreateWSImage (GetObject ('Schedule'), 200 - (Width of WS), 200); which will be inside the drawing border at the top right. Since the WS reference point is top left then I need to move it Width(WS) to the left of the border. How do I work out the width of the WS??
  13. Thanks Kevin, That worked. However, the only reason why I used Chr instead of '°' in 2016 is that '°' stoppe working in 2016. Worked fine in previous versions. So, no Alt0176 in macros, no Chr(176) {replaced by 161} in macros, but Alt0176 is still working when typing text within the drawing. A bit of a mishmash hey. I thought VW used the ASCII western character set.
  14. Hi, Can anyone tell me how to get ° into my code/text please? It seems to have been overlooked in VW2016 procedure AngleText; var pt1, pt2, pt3, pt4 : vector; begin GetPt (pt1.x, pt1.y); GetPtL (pt1.x, pt1.y, pt2.x, pt2.y); GetPtL (pt2.x, pt2.y, pt3.x, pt3.y); pt4 := (pt1 + pt3) / 2; TextOrigin (pt4.x, pt4.y); CreateText (Concat (Num2Str (2, AngBVec (pt1 - pt2, pt3 - pt2)), Chr (176))); end; run (AngleText);
  15. Thanks Dieter, you've been a great help. With the code above I suddenly realised that Case Item of SetupDialogC: GetTBdialog1Events; should really be Case Item of SetupDialogC: SetupEvent; which stops all the loops I was originally perplexed about. Thanks again and have a great holiday period.
  16. Thanks Dieter, you are correct. I shall use code tags next time. So how do I stop this repetition? Can you re-sequence my code as you would suggest is the best format so I don't make the mistake again please. What information are you privileged too :-) that allows you to know that 12255 is an init/setup? Where does the average person find this help?
  17. Not clear on what you meant but case 01 obviously runs at startup. So what if I want to add OldTyp := Concat (OldTyp, '1'); into the procedure GetTBdialog1Events; The end result would be 'AA11' because it loops through the case 01 twice. How is that useful?
  18. I still don't understand why, if item = 12255 then case 01 is run.
  19. Additionally I can't add 12255 to the case list to force it not to pick 01 but 12255 seems to be a duplicate case value. Why?
  20. Why does the following loop through No.4 (case 01) before OK is selected? After No.1 I would have expected No.2 to be 0, not 12255. However, even though No.2 is 12255 (which is not a case item) it still runs case 01 (No.4) and then No.3 (still 12255) before the dialog appears in the top left of my screen (why there??). If I choose OK then No.2, No.4, No.3 is correct as I would expect but why does it then go No.2 12256, No.3 12256. Where am I going wrong? procedure Main; var TBdialog1 : longint; OK : boolean; GridTyp, OldTyp : string; procedure CreateTBdialog1; begin AlrtDialog ('1. '); TBdialog1 := CreateLayout ('Data', False, 'OK', 'Cancel'); CreateStaticText (TBdialog1, 4, 'Data Type:', 20); CreateCheckBox (TBdialog1, 5, ' A'); CreateStaticText (TBdialog1, 7, 'Reference:', 20); CreateEditText (TBdialog1, 8, OldTyp, 20); SetFirstLayoutItem (TBdialog1, 4); SetRightItem (TBdialog1, 4, 5, 0, 0); SetBelowItem (TBdialog1, 4, 7, 0, 1); SetRightItem (TBdialog1, 7, 8, 0, 0); end; procedure GetTBdialog1Results (var Item : longint; Data : longint); procedure GetTBdialog1Events; begin GetBooleanItem (TBdialog1, 5, OK); GetItemText (TBdialog1, 8, GridTyp); UprString (GridTyp); AlrtDialog (Concat ('4. ', GridTyp)); end; begin AlrtDialog (Concat ('2. ', Num2StrF(Item))); Case Item of SetupDialogC: GetTBdialog1Events; 01 : GetTBdialog1Events; 02 : ; { Cancel } end; { case } AlrtDialog (Concat ('3. ', Num2StrF(Item))); end; begin OldTyp := 'AA'; CreateTBdialog1; If (RunLayoutDialog (TBdialog1, GetTBdialog1Results) = 1 { OK }) then begin end; end; run (Main);
  21. Here's what I am trying to do (attached). If I draw "1" then I want the macro to fillet the corners, create a profile and extrude along path. As you can see, if I fillet the corners with the fillet tool and I use a macro that I have already written then I get what I want. But why should I fillet the corners when VW can do it. If I change this 3D Polygon to a ConvertToPolyline then I can SetPolylineVertex but when VW ConvertToPolyline it flattens the polygon to 2D. The only solution is to CreateNurbsCurve to which I have to AddVertex3D and that's why I wanted to understand the fillet mathmatics. The only other option I have is to call the fillet tool during the macro so the operator can fillet the corners and then the macro will continue to extrude a pipe. Can you suggest any alternatives? :-)
  22. After seeing this - https://en.wikipedia.org/wiki/Non-uniform_rational_B-spline I think it's all too hard for me. I think this should be on the wish list since VW has already created the Fillet Tool which works on nurbs curves, all we need them to do is create a procedure or function we can use. Something like h1 := FilletPath (h, 140, var error); which fillets any type of line in 2D or 3D and returns an error code if it can't do it or one of the fillets is less than the required radius. Anyone else want to comment before I wish it?
  23. Thanks Josh, I've tried that but even though my example is top view, it could just as easily have a twist (z) factor. If it has a z value then ConvertToPolyline vertically flattens the shape which changes the angle between the lines. I have nearly finished this macro but I just need to add the vertices to make a proper radius fillet. Someone wrote the fillet tool in the first place so someone should know the answer to this question.
  24. How do you calculate the Vertex points for a fillet in a Nurbs Curve? On the attached I have drawn a 1000 x 1000 @ 20° angle using the 3D Polygon Tool. I then filleted the angle @ R140 using VW Fillet Tool. When you double click the result you see 6 vertex points. The tangent (Adj = 794) is easy to find but how does VW locate the two vertices at 589 ? I am planing to calculate and AddVertex3D but unless someone can come up with a better idea then I need to find these other two points to finish the fillet.
  25. Excellent Raymond, Yes I can understand the problem of finding that Insert point when the angle changes so I'll work on that next. I did try changing the last vertex but I didn't think of the relationship between them which would be broken by adding the vertex. Regards
×
×
  • Create New...