Jump to content

MullinRJ

Member
  • Posts

    2,007
  • Joined

  • Last visited

Posts posted by MullinRJ

  1. In adding to what @C. Andrew Dunning just posted. Look at the Num2StrF() function. It will format a dimension value to the current document units. So, if you work a problem in inches, but your document units are mm, then Message(Num2StrF(1")); will show '25.4 mm'. This may help your dialogs present document units, not calculation values.

    ValidNumStr() works in the opposite direction, converting formatted string data and returning dimensioned numeric data. 

     

    Bottom line, there are several ways to skin this cat. (Apologies to all cats for that last remark.)

     

    Raymond

    • Like 1
  2. 1 hour ago, SamIWas said:

    Are you in the Atlanta area?  I have a bunch of friends who have lost power after a storm rolled through a few hours ago

     

    No, North Texas. About 25 miles north of Dallas. No storms! Just heat. The good news is that it didn't take until midnight to come back on. Only about 90 minutes down. Next week is forecast to be up to 10°F hotter. If you don't hear from me, you'll know why.

     

    Raymond

  3. 46 minutes ago, Pat Stanford said:

    @MullinRJ

    Did I hear my name? It is something that Reshaper can do. In Front view, with one of the BOTTOM anchor points selected, and the Next Click mode selected, the user can click on the top of any 3D object in the drawing and click the OK button. That will move the selected object to sit atop the clicked-on object.

     

    As far as an existing script goes, I don't know of any, but it wouldn't be too difficult to write. Get the 3D-BBox of both objects, calculate the ∆Z between the bottom of one object and the top of the other, then move the one object up or down by that amount.

     

    Raymond 

    • Like 2
  4. 16 minutes ago, Jesse Cogswell said:

    Any idea how to use custom images for buttons outside of the standard Vectorworks icons?

     

    Hi @Jesse Cogswell,

       Place your images in a folder. Select the folder and ZIP the folder. With the resulting ZIP file, change the .zip extension to .vwr and you now have a VW Resource file.

     

       I believe the commands you referenced can use the path of the .vwr file as your path input. I haven't tried it, so please let me/us know how it turns out.

     

    Thanks,

    Raymond

    • Like 1
  5. Unlike you, I haven't thought about this for more than a minute. You can skip the redraw event with an IF statement, but I think the PIO will erase everything before you skip the redraw. If you don't redraw something, you may have difficulty selecting it afterwards. You can try it, but I don't recommend it. Perhaps someone has a more informed opinion on this. Be careful.

     

    Raymond

  6. I have always placed vsoStateClear() as the last statement in event 3 (kResetEventID). I think you're good if you remove the comment brackets. Also, I think it is a necessary command, but I've never removed it to see what happens.

     

    Raymond

  7. Hi @Sam Jones,

       While the repository exists for storing and retrieving temporary settings, how do you propose finding anything in there that you did not place yourself? What names are available? The dialog in question is a stock dialog, factory owned and operated, and while it may be true that someone at the factory may inform you of a setting's name, this is not expected to be common practice. 

     

       Perhaps we might all benefit if someone were to post a VE to request such a list be published. Innnnn the meantime – WWJBD? 😉

     

    Raymond

  8. @Pat Stanford is right — again. 😉 (A nod to consistency.)

     

       While you can't force a dialog into a known state via script, if you use the dialog once, it will remember its last state. Subsequent calls will open with the same settings as the last time. This memory doesn't persist across VW sessions, but it will remain as long as VW stays open. 

     

       If you use the command a lot while you're working, you can benefit from setting it up initially. If you only use it occasionally, then my advice won't save you much, if any, time.

     

    Raymond

  9. I'm guessing here, but you may need to enable something before it will work.

     

    Do you have this turned on?

    result := SetObjPropVS(kObjXPropAcceptStates, TRUE);                    { 18 }
     

    Set it in the kObjOnInitXProperties event.     { event 5 }

     

    I've found that many events can be hidden from your code if they are not properly enabled first. If it's not this, it may be something else.

     

    Raymond

    • Like 2
  10. To duplicate a view that was previously saved, use VRestore() with the name of a previously saved view, make any changes you want to the now-current view, then use VSave() with a new name to save the modified view. There is no way to edit the attributes of a saved view entity, just save a newly modified view under a new name. 

     

    If you want to return to the view you had just before the edits, try this:

     

    VSave('This view');      { temporary view }

    VRestore('An Existing View');

    ...

     { make all desired changes to the view HERE. }

    ...

    VSave('A New View');   { based on An Existing View }

    VRestore('This view');

    VDelete('This view');    { clean up named view clutter }

     

    HTH,

    Raymond

  11. Modern Dialog StaticText colors are OUT, tints are IN.

     

       In VW 2023, SetStaticTextColorN() was introduced to replace SetStaticTextColor(), which failed in VW 2020 on the Mac (VB-160901), and StaticText now receives discrete  TINTS, and not the full range of colors that could be generated with the older SetStaticTextColor(). In exploring the available tints, I found some shortcomings. 

     

    1) There is no BLUE (203). The index assigned to blue actually generates a color close to cyan.

    2) PINK (208) is not a distinct color. It looks exactly like RED (200).

    3) MAGENTA is missing from the list. Is this what PINK (208) was supposed to be?

        The 3 primary colors (RGB) and the 3 secondary colors (CMY) should be represented. Currently we have (RG and CY).

     

       Here is a screenshot of a test dialog. 

    537561336_DialogColors.png.15a5659869ee54fd8732cc5ed3b5a46b.png

       I reviewed the output on two monitors with very different color balances and the tints have the same appearance on both monitors. I have not tried this on a Windows machine.

     

       I do like the Orange (204), Purple (207), and Gray (209) shades. Brown (206) and Yellow (205) are hard to see against the gray background of the dialog. The older command, SetStaticTextColor(), was much more flexible in that I could tweak the RGY color components to get a shade that had good hue and good contrast. The current tints leave a lot to be desired. If I could request additional shades, I would like darker versions of Red, Green (especially), and Blue. Is this even possible?

     

       If anyone wants the code for this dialog, just ask. I'll be happy to send it to you.

     

    Raymond

    • Like 2
×
×
  • Create New...