C++ PivotMode

C++ PivotMode

istan
Advisor Advisor
1,178 Views
3 Replies
Message 1 of 4

C++ PivotMode

istan
Advisor
Advisor

I got another one: How can I set the Viewport Pivot-Mode from C++?

In MXS listener I see: macros.run "Tools" "PivotMode_Toggle" -- when pressing the <INS> button on an selected object.

In an old Interface7() I found something, but it does not work.

0 Likes
Accepted solutions (1)
1,179 Views
3 Replies
Replies (3)
Message 2 of 4

istan
Advisor
Advisor
Accepted solution

Solved. Using "maxops.pivotmode".

 

PS: found in the good old sparks message archive 🙂

0 Likes
Message 3 of 4

denisT.MaxDoctor
Advisor
Advisor

@istan wrote:

I got another one: How can I set the Viewport Pivot-Mode from C++?

In an old Interface7() I found something, but it does not work.


What is wrong with Interface7::GetPivotMode ?

 

Never had a problem with it...

Here is the code from my library... (looks like pseudo, but it should make sense 😉

def_visible_function(getPivotMode)
{
	check_arg_count_with_keys(getPivotMode, 0, count);
	auto mode = mxs_ip(7)->GetPivotMode();
	bool asname = is_true_key(name);

	if (asname)
	{
		switch (mode)
		{
		case PIV_NONE:				return n_none;
		case PIV_PIVOT_ONLY:		return n_pivot;
		case PIV_OBJECT_ONLY:		return n_object;
		case PIV_HIERARCHY_ONLY:	return cust_name(hierarchy);
		}
		return_undefined;
	}

	return int_value(mode);
}

 

0 Likes
Message 4 of 4

istan
Advisor
Advisor

Thx Denis, was just a minor thing.

Is now working with the mxs - when I find time, I'll check it again.

0 Likes