Jump to content

MullinRJ

Member
  • Posts

    2,109
  • Joined

  • Last visited

Reputation

594 Spectacular

Personal Information

  • Occupation
    Circuit Board Designer
  • Location
    United States

Recent Profile Visitors

7,980 profile views
  1. Hello @Flair-Studio, If you are using a Worksheet as you say, in your worksheet column header for the SymbolName, do you have the Sort menu set to Ascending or Descending? If it is set to None you will get a random order. To get to the Sort control, click on the little button at the right of the column header formula, as shown in the picture below. The dialog shown will appear. You can also use the Graphic Legend tool to do something similar with symbol names and images, but I don't know if you can format other information like you can in a Worksheet. Raymond
  2. The DevKiki uses an outdate example. I've updated it below. Use this instead: {Slider Control Example - updated 21 Sep 2024 by RMullin} PROCEDURE dialog1_Main; CONST kSlider = 4; kLabel = 5; kValue = 6; VAR dialog1 :INTEGER; gSlider :LONGINT; PROCEDURE dialog1_Handler(VAR item :LONGINT; data :LONGINT); BEGIN CASE item OF kSlider: BEGIN GetControlData(dialog1, kSlider, gSlider); SetItemText(dialog1, kValue, Concat(gSlider)); END; { kSlider } END; { CASE } END; { dialog1_Handler } BEGIN gSlider := 1000; { max slider value } dialog1 := CreateLayout('Slider Control', FALSE, 'OK', 'Cancel'); CreateControl (dialog1, kSlider, 3, '', gSlider ); CreateStaticText (dialog1, kLabel, 'Slider Value: ', -1); CreateStaticText (dialog1, kValue, '0', 4); SetFirstLayoutItem (dialog1, kSlider); SetBelowItem (dialog1, kSlider, kLabel, 0, 0); SetRightItem (dialog1, kLabel, kValue, 0, 0); IF (RunLayoutDialog(dialog1, dialog1_Handler) = 1) THEN BEGIN END; { IF } END; RUN(dialog1_Main); And then I noticed this was in the Python Forum, so here is the corresponding example in Python. # Slider Control Example (python) - updated 21 Sep 2024 by RMullin def dialog1_Handler(item , data): if (item == kSlider): gSlider = vs.GetControlData(dialog1, kSlider); vs.SetItemText(dialog1, kValue, vs.Concat(gSlider)); def dialog1_Main(): global kSlider global kLabel global kValue global dialog1 global gSlider kSlider = 4 kLabel = 5 kValue = 6 gSlider = 1000 # max slider value dialog1 = vs.CreateLayout('Slider Control', False, 'OK', 'Cancel') vs.CreateControl (dialog1, kSlider, 3, '', gSlider) vs.CreateStaticText (dialog1, kLabel, 'Slider Value:', -1) vs.CreateStaticText (dialog1, kValue, '0', 4); vs.SetFirstLayoutItem (dialog1, kSlider) vs.SetBelowItem (dialog1, kSlider, kLabel, 0, 0) vs.SetRightItem (dialog1, kLabel, kValue, 0, 0) if (vs.RunLayoutDialog(dialog1, dialog1_Handler) == 1): pass kSlider = 0 kLabel = 0 kValue = 0 dialog1 = 0 gSlider = 0 dialog1_Main() HTH, Raymond
  3. Hello @AlHanson, Check out CreateControl(). You can then use the itemID to get data needed to set your gradient. Some assembly required. CreateControl(dialogID, itemID, 3, name, data); { 3 = Slider } I haven't used this in quite a while so read all of the notes in the DevWiki before using. There is a Slider example there. Raymond
  4. Valuable? Nope. Just theatrics. It's Tuesday.
  5. What I don't understand is why you both didn't discuss which computer platform is better? 😛 "It's quite obvious you are both comfortable using VW in your own way36. Why the posturing?", I muse quietly from the sidelines. Oops, did I hit Submit?!? Damn! Raymond
  6. Hello @pascalachermann, In theory, YES, you should be able to work inside a symbol definition. The problem I face concerns the two functions you use in your script that are not native to VW. Even if I guess how to structure your code, I cannot test it because it will not compile on my machine. I cannot even test the example that @Zuzzla posted, again because it uses the same two functions. Try his/her example and see if it works, then let us know how it went. All the best, Raymond
  7. Hello @pascalachermann, I was able to open your new file. However, I still am not able to run your Python script to see what it does, because it contains unique calls that are only available to you on your VW installation, namely: vs.GetNumFaces() and vs.GetPolyFaceNormal(). I think your best bet is to find someone with the same VW installation to help you. If there is a way to post the workings of those two functions, then more people on this forum might be able to lend a hand. All the best, Raymond
  8. Hi @Matt Overton, I don't think this issue falls into the category of a workaround. After further investigation by several members in this thread I believe it was determined there really is a bug with the way the Scale Bar tool operates. I'm pretty sure VW will address it promptly. Raymond
  9. Hi @Tom W., It gets curiouser and curiouser each time I go back. I now see what you are seeing. But only after I toggle the "Adjust Units" checkbox two or three times does the display change to an "M". The first few times I toggle it, I see "mm". Only if I keep toggling it does the unit change to "M". I then opened a new document in "mm" and placed the Scale Bar. I get an "M" right away. After toggling the "Adjust Units" checkbox several times I finally see "mm" alternating with "M". When I pause several seconds between toggles, the units don't switch, but repeat either mm, mm, mm or M, M, and then they start switching again. I was not able to see a pattern of what was going to display on the next toggle. It's DEFINITELY broken. Raymond
  10. @Tom W., You have me at a loss. I just tried the Scale Bar tool in multiple units (all standard VW defined), and I always get a small "m" for meters, regardless of the Adjust Units setting. Without access to your system settings I don't know what to suggest. However, you can look directly at the Units Mark for your current Units setting with this one-line Vectorscript. AlrtDialog(concat('Units mark – "', GetPrefString(154), '"')); If it differs from the units mark shown in the Scale Bar tool, then you can definitely point a finger at the tool and/or its settings. Raymond PS - I checked both VW 2024 and 2023 in using Meters as the default unit and they both have a small "m" defined as the unit mark. This is on US Mac version.
  11. And I thought everyone would be happy that you CAN define a unit standard with the look and feel you desire – TODAY. I'm pretty sure this will be addressed in the future, but rejoice that you don't have to wait for a future release. This is a good thing. 🙂 Raymond
  12. Hello @Anders Brix, You can have your "little m" and display it, too. Create a custom unit in the Units Dialog (menu File-> Document Settings-> Units.) Click on the Custom... button. You can call it "Meters" and it will display as "Meters (Custom)" as follows: To make this a universal change, create a template file and save it as "Meters". Set your favorite Layer Scale, and other attributes, the way you like them (assuming they are not already set), and use menu File-> Save as Template... . This will create a stationary file, with .sta as the file extension, and place it in your User Folder. When you create a new file, select your new template file as shown. The custom Meters units will be defined and selected. You'll get the "small m" when units are displayed throughout the document. Note: When you assign the unit letter (m), you can include a space before it " m", or omit the space. Some people like the unit to abut the numeric value, and some do not. Your choice. HTH, Raymond
  13. @Mackenzie Cleaves, Please post a sample VW file with your GFCI symbol. Raymond
  14. Hello @kliefhead, Short answer: Add it to your workspace. If you are not familiar with adding a plug-in to VW, a longer answer follows. The file I added is not a script, but a Plug-in Tool. It has a short script inside it. You will have to add the .vst file to your Plug-ins folder in the VW 2024 User Folder to make it useful. To find the User Folder on your drive, open the VW Preferences dialog and select "User Folders" in the left pane. In the right pane there is a "Reveal in Finder" button. Press it and the VW User folder/directory will open on your computer. Open the folder that says 2024 (which should be selected) and copy the Orient.vst file into the Plug-ins subfolder. Then close VW and launch it again. VW will now recognize the newly added Orient tool. When VW is open again, open the Workspace Editor (Cmd+Opt+Shift+W, on the Mac; Ctrl+Alt+Shift+W on the PC; or VW menu Tools->Workspaces->Edit Current Workspace...) Select the Tools tab at the top of the window and expand the >Tools category in the left pane by clicking on the arrow to the left of "Tools". Find the Orient tool, and drag it to one of your tool pallets in the right pane, or create a new Tool Palette and add it to that. The tool is now accessible to VW in the palette you chose when you are drawing (it will have a default wrench icon, and will show "Orient Tool" when you hover the cursor over it.) Before you close the Workspace Editor, you can assign a HotKey (keyboard shortcut) to the new tool for faster access. This last step is optional. For more information on using the Workspace Editor, open VW Help (F1) and search for "workspace edit". Click on the "Customizing workspaces" link that pops up. HTH, Raymond
×
×
  • Create New...