Notifications
Clear all

[Closed] UIAccessor with Bevel Profile modifier,

 j83
(
	/*
	--------------------------------------------
		Generic UIAccessor function
	--------------------------------------------
	*/
	fn UiButtonPress mainName buttonName indexOfButton =
	(
		local validButtonWindow = windows.getChildHWND #max mainName
		if ( validButtonWindow != undefined) do 
		(
				local buttons = windows.getChildHWND (UIAccessor.GetParentWindow validButtonWindow[1]) buttonName
				if ( buttons != undefined ) then
				(
					if (indexOfButton > buttons.count) then
					(
						print "Invalid button index provided for UiButtonPress function."
					)
					else
					(
						UIAccessor.PressButton buttons[indexOfButton]
					)
				) 
			)
	)
	
	/* Create a rectangle */
	local ourTestObject = rectangle pos:[0,0,0] width: 100 length: 100 wirecolor:green
	addModifier ourTestObject (Bevel_Profile Produce_Mapping_Coords:1)
	
	/* Create another shape to potentially use as a shape for the bevel */
	local ourTestProfile = circle radius: 20 pos: [0,(ourTestObject.max - ourTestObject.min)[2], 0]
	
	select ourTestObject
	max modify mode
	modPanel.setCurrentObject ourTestObject.modifiers[ourTestObject.modifiers.count]
	
	/* Now the main object should be selected, and the "Pick Profile" button will be pressed */
	UiButtonPress "Bevel Profile" "Pick Profile" 1
	
)
 Unforutanetly, Max 2010 Maxscript documentation states that with the Bevel Profile modifier,
 There is no way to set the Profile shape using MAXScript in 3ds Max.
 I say nay! :)  It is not critical that I use this for the tool I'm working.  However, just throwing this out there before I move to another method to accomplish this task.

UIAccessor presses the correct button for me, so the pick is the only remaining part.  Anyone ever simulate a click event?

I was thinking possibly doing something with the Windows API and clicking but not sure if there’s another, more useful method.

1 Reply

i showed in this forum how to simulate a mouse button click in a viewport.