MullinRJ
Member-
Posts
2,004 -
Joined
-
Last visited
Content Type
Profiles
Forums
Events
Articles
Marionette
Store
Everything posted by MullinRJ
-
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
-
align bottom of object to top of another
MullinRJ replied to grant_PD's question in Wishlist - Feature and Content Requests
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 -
align bottom of object to top of another
MullinRJ replied to grant_PD's question in Wishlist - Feature and Content Requests
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 -
CreateRadioButton2 and CreateCheckBox2 functions not working
MullinRJ replied to twk's topic in Python Scripting
@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 -
CreateRadioButton2 and CreateCheckBox2 functions not working
MullinRJ replied to twk's topic in Python Scripting
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 -
CreateRadioButton2 and CreateCheckBox2 functions not working
MullinRJ replied to twk's topic in Python Scripting
it's actually inside the VW Application, in a resource file. -
CreateRadioButton2 and CreateCheckBox2 functions not working
MullinRJ replied to twk's topic in Python Scripting
@Pat Stanford, The path is INSIDE the VW app. It took me a while to find it, too. Raymond -
CreateRadioButton2 and CreateCheckBox2 functions not working
MullinRJ replied to twk's topic in Python Scripting
@tui_k, 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 -
vsoWidgetPopup not unique to different instances
MullinRJ replied to Jayme McColgan's topic in Python Scripting
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
-
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
-
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
-
Changing Saved View Properties Programmatically
MullinRJ replied to El Dinyo's topic in Vectorscript
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
-
I take the previous post back. If that were the case, it would purge. So it is attached to something. Probably a resource and not an object. Raymond
-
@Pat Stanford, this is hypothetical, but if you had the equivalent of the following occur in the import process you would have a 'BoB' class created with no object(s) associated with it. NameClass('BoB'); NameClass('Boundary'); Rect(0, 11, 15, 0); NameClass('None'); { return to default class } Perhaps it comes about like this: NameClass('BoB'); { object is omitted from export, but not before its class is defined } NameClass('Boundary'); Rect(0, 11, 15, 0); NameClass('None'); { return to default class } Raymond
-
to automate updating titleblock w/ viewport scale
MullinRJ replied to Neda Roohnia's topic in Python Scripting
If a function doesn't exist, you can always create a lookup function for the typical values you find in Imperial Scales. Something like this: def ImpScale(SF): # return the imperial scale string for typical Layer Scale Factor values (SF) if SF == 4: return '3"' elif SF == 6: return '2"' elif SF == 8: return '1-1/2"' elif SF == 12: return '1"' elif SF == 16: return '3/4"' elif SF == 24: return '1/2"' elif SF == 32: return '3/8"' elif SF == 48: return '1/4"' elif SF == 64: return '3/16"' elif SF == 96: return '1/8"' elif SF == 192: return '1/16"' elif SF == 384: return '1/32"' elif SF == 120: return '1"='+"10'" elif SF == 240: return '1"='+"20'" elif SF == 360: return '1"='+"30'" elif SF == 480: return '1"='+"40'" elif SF == 600: return '1"='+"50'" elif SF == 1200: return '1"='+"100'" else: return '1:'+str(SF) SF = 1 while not vs.DidCancel(): SF = vs.IntDialog( 'Enter a scale factor', str(SF)) if not vs.DidCancel(): vs.AlrtDialog(ImpScale(SF)) # test the function Raymond