Jump to content


  • Posts

  • Joined

  • Last visited

Everything posted by WhoCanDo

  1. Can anyone suggest an option to fix this problem. I have dragged and dropped a PDF file into my drawing, which works great when I use a white background setup. However, I use a black background preference to reduce eye strain and tiredness. It's also great for clarity and contrast. This is the result. I've tried giving the PDF a white background, but that doesn't work.
  2. Moving on, now I can't locate a concaved wall within the perimeter of a polygon. For the following, create the polygon first, and then the walls. The idea being, the polygon is the first selected object. Pick all the objects and run this macro... procedure test; var hMKP : handle; procedure Record_Data (h : handle); begin AlrtDialog (Num2Str (0, GetTypeN (h))); end; begin DelName ('Tmp'); hMKP := FSActLayer; SetName (hMKP, 'Tmp'); SetDSelect (hMKP); ForEachObject (Record_Data, (Loc = 'Tmp') & (Sel = True) & ((T = Wall) or (T = RoundWall))); end; run (test); The result is AlrtDialog will return 68 (straight wall), 89 (round wall) & 89 in any order. However, there are three 89's and the wall on the right is not recognised as being within the perimeter of the polygon. I would suggest that this is a bug with "Loc=" but can anyone suggest another solution to please?
  3. Thanks Mate, I just figured out why it's happening. I am ctrl-picking up with mouse, to duplicate and move. Weird but not so much of a problem now. We have new computers and I was worried it was the graphics card not keeping up. Regards
  4. Thanks for putting me on the right track Julian, My fault. I should have put SelectChoice (StanDialog1, 5, 2, True); instead of SelectChoice (StanDialog1, 5, 2, TF); From the other procedures I tried, TF was a boolean result, not an boolean option.
  5. Thanks Julian, I've tried SelectChoice among several others but it's still not working. Maybe I'm putting it in the wrong place, even though I've been moving it around during my attempts. procedure test; var StanDialog1 : longint; TF : boolean; procedure CreatePopUpLayout; begin StanDialog1 := CreateLayout ('Component Data', False, 'OK', 'Cancel'); CreateStaticText (StanDialog1, 4, 'Item:', 15); CreatePullDownMenu (StanDialog1, 5, 10); SetFirstLayoutItem (StanDialog1, 4); SetRightItem (StanDialog1, 4, 5, 0, 0); end; procedure DialogHandler (var Item : longint; Data : longint); procedure InitiateDialog; begin AddChoice (StanDialog1, 5, ' ', 0); AddChoice (StanDialog1, 5, 'A', 1); AddChoice (StanDialog1, 5, 'B', 2); SelectChoice (StanDialog1, 5, 2, TF); end; procedure GetDialogEvents; begin end; begin Case Item of SetupDialogC: InitiateDialog; 1 : GetDialogEvents; 2 : ; { Cancel } end; { Case } end; begin CreatePopUpLayout; If (RunLayoutDialogN (StanDialog1, DialogHandler, True) = 1 { OK }) then begin end; end; run (test);
  6. Hi, I have a CreatePullDownMenu in my Dialog Box and I have loaded it with AddChoice How do I choose to select ItemIndex 10 on the PullDownMenu ? I have been trying SelectChoice without luck. SetFocusOnItem works to focus on the ComponentID but I also want to separately set ItemIndex 10 to be the focus. Regards
  7. Does anyone else have the problem that we have on 2019 Sp4? If you draw a 2D rectangle on a layer and pick it up with the mouse and move it in a circular motion on the screen, does the rectangle lag behind your mouse more and more as you continue?
  8. Got it. So my code should be procedure AddChoices; begin end; procedure GetDialogEvents; begin end; Case Item of SetupDialogC: begin AddChoices; end; 1 : GetDialogEvents; 2 : ; { Cancel } end; { Case }
  9. In the example, where does GetItemText (StanDialog1, 5, Code); etc. happen? How do you get the events/results? I have been shown to create a sub-procedure GetDialogEvents to Dialog_Handler and use it as follows. Case Item of SetupDialogC: GetDialogEvents; 1 : GetDialogEvents; { OK } 2 : ; { Cancel } end; { Case }
  10. The old Dialog method was easier to understand, but harder to setup, than the new, so I've not completely grasped the process yet. This is how I have formatted mine, so where to you put AddChoice? 1. Set up Dialog layout. 2. Get Dialog results. procedure GetEvents; begin GetItemText (StanDialog1, 5, Code); end; begin SetupDialog; Case Item of SetupDialogC: GetEvents; 1 : GetCodeDialog1Events; 2 : ; { Cancel } end; { Case } end; 3. Do something with the results
  11. Hi, Where do you put AddChoice to load CreatePullDownMenu? If I put it here, while Creating the Dialog layout, it doesn't work.. procedure CreateDialog1Layout; begin StanDialog1 := CreateLayout ('Handrail ID', False, 'OK', 'Cancel'); AddChoice (StanDialog1, 7, ' ', 0); AddChoice (StanDialog1, 7, 'R', 1); AddChoice (StanDialog1, 7, 'L', 2); If I put it here, after Creating the Dialog layout, it doesn't work.. CreateDialog1Layout; AddChoice (StanDialog1, 7, ' ', 0); AddChoice (StanDialog1, 7, 'R', 1); AddChoice (StanDialog1, 7, 'L', 2); If (RunLayoutDialogN (StanDialog1, GetCodeDialog1Results, True) = 1 { OK }) then If I put it here, it duplicates the list repeatedly while picking or filling in other Edit boxes.. procedure GetDialog1Results (var Item : longint; Data : longint); begin AddChoice (StanDialog1, 7, ' ', 0); AddChoice (StanDialog1, 7, 'R', 1); AddChoice (StanDialog1, 7, 'L', 2); Case Item of SetupDialogC: GetDialog1Events;
  12. Hi, Can we have the shortcut key name/description we used last (or better still a list of shortcuts in order) listed in the VW footer near the X: & Y: references so we can see what we did last by accident LOL. I sometimes touch another key when wanting a shortcut and I am not sure what it did because I am touch typing. eg. sometimes I hit ctrl-shift-C instead of ctrl-C and I don't know what happened because I wasn't looking at the keyboard. Then I can't find my Snapping menu.
  13. That's too simple, but it works ☺️ I tried MouseDown without luck to I thought it needed some Tool command. Thanks.
  14. That could help if I needed to move the text from 0, 0 at a later stage ☺️ But I would like to know where to move it. I would like to know where the user clicked to place the text. If the tool was set up with parameters (eg. x1 - X Coordinate, y1 - Y Coordinate), would the recordHandle record them and how do I get them out?
  15. Hi, I'm making a custom tool that places text, with data attached, onto the drawings. If the user picks a point on the drawing, how do I determine where that is? How do you get feedback from the tool?
  16. Hi, I am adding data to multiple objects selected at various locations on my drawing. I would like to zoom in on each object when the user is asked for options. procedure Zoom (hZ : handle); var ZoomX, ZoomY : real; begin { SetName (hZ, 'Target'); ZoomX := XCenterN (N = 'Target'); ZoomY := YCenterN (N = 'Target'); } DoMenuTextByName ('Fit To Objects', 0); SetZoom (280); end; This doesn't work because it Fit's to all objects before Zooming in on the center of the selection. Other ideas are within the brackets. Maybe ForEachObjectInList, but I don't know how to generate a list. I would then SetSelect (hZ) to zoom in on it. Can anyone expand on the above please?
  17. If I place a constrained dimension with VS ( LinearDim ) , can I offset the text left or right with a VS command?
  18. It would be nice if there was a search bar in the "Script Editor" with a forward and backward option.
  19. Thanks Pat, Since I didn't know about "Point", I tried defining the variable as "Vector", but it didn't work (note for anyone else reading this). 😉
  20. I've never seen "Point" before. How is that different from "Vector"
  21. Ahh, You are correct. However, it is in the ScriptFunctionReference.html Mirror VectorScript Declaration: FUNCTION Mirror ( h :HANDLE; dup :BOOLEAN; VAR p1X :REAL; VAR p1Y :REAL; VAR p2X :REAL; VAR p2Y :REAL ) :HANDLE ; Python: def vs.Mirror(h, dup, p1, p2):    return HANDLE Description: Reflect an object across an axis. For a 2D reflection, the axis is a line containing arbitrary point p and extending along vector v. Parameters: h The object to reflect dup If false, transform the original object to the new position. If true, create a new object p1 An arbitrary point on the mirror axis p2 A second arbitrary point on the mirror axis Result: The reflected object (this will be the same as the input object if dup is false).
  22. hTmp := Mirror (hTmp, True, P1x, P1y, P2x, P2y); Can someone suggest why VS returns the error "Expected a point" at the first comma after the P1x please? I have var P1x, P1y, P2x, P2y : real;
  23. Hey, I've just found out that PDF drawings can be dragged and dropped into VW. You can even do this with multiple PDF files at the same time. 👌😃
  24. Got it Pat, I think I was heading toward Naming something other than the group but your suggestion of Naming something within a group worked perfectly. Thanks 😃
  • Create New...