how can i create shape button with script ?
hi
i would like to press button create- spline - recangle button with hwnd way
i modified sample code but error
what problem ?
fn pressButton hwnd: name:"OK" =
(
if hwnd == unsupplied do hwnd = DialogMonitorOPS.GetWindowHandle()
UIAccessor.PressButtonByName hwnd name
)
hwnd = windows.getchildhwnd #max "Create Shape"
DialogMonitorOPS.unRegisterNotification id:#rectangle
DialogMonitorOPS.RegisterNotification pressButton id:#rectangle
DialogMonitorOPS.Enabled = on
UIAccessor.PressButton hwnd[1]
DialogMonitorOPS.unRegisterNotification id:#rectangle
DialogMonitorOPS.Enabled = off
Comments
.
use startObjectCreation
hi jahman , there is some problem ~
i made this
but there is error ~
pls can you test ? ~
xx= startObjectCreation rectangle
select xx
max modify mode
modPanel.addModToSelection (Extrude ())
$.modifiers[#Extrude].amount = 50
.
you have to read the docs again :) if you want startObjectCreation to return value
i made this , pls check ~
i made this
but if i esc press , there is no "add modifier" function for undeifined
pls check again
sorry for many question ~
while not keyboard.escPressed do
(
measureLine = startObjectCreation rectangle returnNewNodes:true newNodeCallback:setColor
addModifier measureLine[1] (extrude amount:100000)
convertToPoly measureLine[1]
select (for obj in objects where intersects obj measureLine[1] collect obj)
deselect measureLine[1]
bigbox = selection[1]
ProBoolean.createBooleanObjects bigbox measureLine[1] 2 0 0
ProBoolean.SetPlanarEdgeRemoval bigbox 3
)
.
good.
just add another check to ensure that measureLine[1] actually contains a valid node
what your script is supposed to do?
Thank you ~~
This script is used to cut objects
I often use box object.
So i have to cut box.
So i made this.
Thank you
I will check your advice ~~~
.
I guess you don't really need while loop at all
wow wow perpect
You are always so perfect
And I envy your concise code
You can only say that you are a real genius
Thank you so much for helping me so many times
.
thanks
Code simplicity comes from practice and reading a LOT of others code.
You don't have to be a genius at all to write a good maintainable code after a few years of daily practice.
It is actually harder to find a maxscript task that wasn't discussed over the past years here or on cgsociety.org. Some googling before writing code is a good idea most of the time.
ok i will tr
thank you
i will try
always thank you for good answer ~~~