Elite Exhibits Posted May 19, 2023 Share Posted May 19, 2023 Question What to add to - Align/Distribute 3D - simple DoMenuTextByName script ? ...to get the dialog box to preselect the Z and Minimum ? (See attached) Peter PROCEDURE DoMenuTextByNameExample; BEGIN DoMenuTextByName('Align/Distribute 3D',0); {Align/Distribite 3D} END; RUN(DoMenuTextByNameExample); 3D Object Align and Distribute Dialog Box_1.pdf Quote Link to comment
Pat Stanford Posted May 19, 2023 Share Posted May 19, 2023 Hopefully someone will tell me that I am wrong, but I don't believe there there are any script commands to interact with dialog boxes generated by menu commands run by DoMenuText. I think if you really want that functionality, your script will basically have to recreate what Align/Distribute 3D does. Sorry. 😞 Quote Link to comment
MullinRJ Posted May 20, 2023 Share Posted May 20, 2023 @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 Quote Link to comment
Sam Jones Posted May 20, 2023 Share Posted May 20, 2023 7 hours ago, MullinRJ said: 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 I don't think this is true. In my experience, dialogs only remember if the "Rpstr_ ..." commands to save values to the VectorScript value repository, and these values are only remembered during the current VW session. One can use the "SetSavedSetting()" and "GetSavedSetting()" commands to set and retrieve dialog settings during and between VW sessions. I defer to @JBenghiat for the source of all VS truth. Quote Link to comment
MullinRJ Posted May 20, 2023 Share Posted May 20, 2023 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 Quote Link to comment
Sam Jones Posted May 20, 2023 Share Posted May 20, 2023 I was late to the party. If the VW dialog stores the values, they will be retrieved. Some VW dialogs do this, I suspect with "Rpstr_ ..." calls; some do not. As you said, they save nothing between sessions. Quote Link to comment
JBenghiat Posted May 20, 2023 Share Posted May 20, 2023 I believe almost all dialogs use the SavedSettings calls. The saved settings get read from an xml file and written to the xml file on quit. One could look at the saved settings files in the user folder and see if the Alignment dialog settings are there, and then change the xml values in memory before running the menu command. You may be able to find dialog controls on the OS level (On the Mac, Automator, Better Touch Tool, or Alfred may provide a solution). I believe all the options have modifier shorty, so even a macro that called the dialog and fired those would work. Or the other way to skin the cat is write a series of scripts that align and distribute objects according to your desired parameters. Quote Link to comment
Pat Stanford Posted May 20, 2023 Share Posted May 20, 2023 Unfortunately, it does not look like the Align/Distribute 3D is one of the tools that uses Saved Settings. I looked in SavedSettings.XML, SavedSettingsDialog.xml, SavedSettignsRsrcMgr.xml and SavedSettingsUsr.xml. I could not find the parameters saved there. And when I restarted VW, the dialog opened without the previous settings. SavedSettingsUser.xml does contain a section for Align Distribute <AlignDistribute> <DlgAlignDistribute3D> <x>2517</x> <y>282</y> <width>597</width> <height>362</height> </DlgAlignDistribute3D> </AlignDistribute> But this looks to be the location and size of the dialog box only. Looks like Sam is probably right about this one using the Repository calls to store information during the current VW run. Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.