[Closed] Get-Selection-Region-Mode: Missing API?
Hey fellas,
How would you get the state of the selection region type? I.E. Box, circle, lasso, polygon, paint selection. There’s a way to cycle through them [max cycle select], but is there any way to know what’s currently in effect? Is there any way to change directly to Lasso or Paint selection?
Thanks!
Anyone? Is this really not exposed at all?
<Sorry, I should really wait more time>
can’t say I’ve spotted anything with regards to getting/setting the mode… there’s the cycle, and there’s a toggle for the window/cross mode – but nothing on the shape.
I’m parking myself here waiting to see if it’s possible… ( would be much useful …)
Glad to see I’m not the only one who wishes this was in the scripting language.
It’s irritating that Autodesk developers aren’t using the same APIs or tools that the rest of us have to use. It makes me want to switch to XSI to see what thier dev support is like…
Anyway; maybe there’s a workaround?
I’m close to a potential workaround, but I’m missing one more thing. Is there any way to create a callback for a keypress (i.e. when keypressed “x” do … : where the keystroke is not part of a textbox)?
Actually, the macrorecorder gave me a good lead. Here’s the macro that hitting Q calls:
macroScript SmartSelect
enabledIn:#("max", "viz", "vizr") --pfb: 2003.12.12 added product switch
category:"Selection"
internalcategory:"Selection"
toolTip:"Smart Select"
buttontext:"Smart Select"
Icon:#("Maintoolbar",11)
(
Try
(
if toolmode.commandmode == #select then max cycle select
Else max select
)
Catch ()
)
Interesting. Rather than trying to get a callback when the user hits Q we can get a callback when the Q keystroke calls this macroscript. The file dir is
<maxroot>\UI\MacroScripts\Macro_Transforms.mcr
For example, and this goes for many UI bound macroscripts, we could include a global declaration such that “SelectionModeState” = 1 and is controlled by this macroscript. Now if you ever need to know what the selection mode state is you can call the global variable.