MullinRJ
-
Posts
2,007 -
Joined
-
Last visited
Content Type
Profiles
Forums
Events
Articles
Marionette
Store
Posts posted by MullinRJ
-
-
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
- 1
-
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
-
I just checked the DevWiki. My memory’s not shot yet. 152 is the upi Pref Index. 😁
Raymond
-
There’s also a VW Preference, 152? (I’m guessing because power is out and won’t be back until after midnight) that returns Units Per Inch.
upi := GetPrefReal(152);You can scale dimensions by that value. Check the number, though.
Raymond -
Hi @grant_PD,
Thank you. At the moment you can PM me and I will send you instructions on how to try Reshaper for 30 days or pay for a license.
All the best,
Raymond
- 1
-
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
- 2
-
@Jesse Cogswell, I'm glad I could help, and I thank you for your "BIG thanks", but really?!?, no Simpson's Yellow Thumb of Approval, 👍? I'm never going to catch @Pat Stanford at this rate. ☹️
Raymond
-
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
- 1
-
it's actually inside the VW Application, in a resource file.
-
-
Using your code on a Mac I get :
but I used: vs.CreateRadioButton2(dialog_id, 6, 'Push Button', layer_icon_path)
instead of: vs.CreatePushButton(dialog_id, 6, 'Push Button')
Perhaps it's a Mac/PC thing. I'll try on a PC, but it may take a while.
Raymond
- 1
-
Event 41 is kObjOnWidgetPrep
Raymond
-
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
-
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
-
Shifting can be done with integers and longints with "n DIV 2" (right shift) and " n * 2" (left shift). Without some complicated code, you will have trouble with the sign bit. For values that do not encompass the full range of bits, "DIV 2" and "* 2" work quite well.
-
There is also Projection(6, 0, 10, -2, -2, 2, 2); , if you don't want to use DoMenuTextByName().
The magic number is 6. The second term sets the rendering mode (0=Wireframe), and the last 5 numbers can be ignored as they apply to Perspective Views.
Raymond
- 1
-
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
-
@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
-
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
- 2
-
Look at this command
WidgetChanged := vsoStateGetParamChng(PIOHand, WidgetID, WidgetIndex, OldSel);
I use it in the kResetEventID { 3 - Object reset has been called } event.
Raymond
-
Short answer - YES. I'll have to look up the way as I don't remember exactly what changes off the top of my head.
Raymond
-
In what context?
Raymond
-
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
-
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.
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
- 2
My intention is to create a script in python where I select self-inserted 3dlocus points. From this selection I need the X,Y and Z coordinates .
in Python Scripting
Posted
Hello @Evert Vandeberg,
Try this:
OBJECTS = [] def collect(handle): OBJECTS.append(handle) vs.ForEachObject(collect, 'VSEL & (T=LOCUS3D)') vs.AlrtDialog('Num selected objects: {}'.format(len(OBJECTS)))
Raymond