ScriptSpot

Forum topic · General Scripting

need help

By AxAurum · 2016-12-22

Description

Hi guys
how can I remove the segment from the shape through the maxscript
please help..

Comments (4)

.

miauu · 2016-12-22


(
	--	"the index of the segment that you want to delete"
	segIdxTodel = #(3)
	subSplineIdx = 1
	splineObj = $Line001
	select splineObj
	max modify mode
	subobjectlevel = 2
	setSegSelection splineObj subSplineIdx segIdxTodel
	updateShape splineObj
	max delete
)

AxAurum · 2016-12-23

Thank you miauu
you just saved me!!!

if you can tell me why my method does not work

(
setSegSelection $ 1 #(3)
subobjectLevel = 2
splineOps.delete $
subobjectLevel = 0
updateShape $
)

.

miauu · 2016-12-23

I don't know.
But this works:



        setSegSelection $ 1 #(4)
	subobjectLevel = 2
	splineOps.delete $
	subobjectLevel = 0
	updateShape $

As you can see if the code is executed without brackets(everytnig is in global scope) the segment will be deleted. If the splineOps.delete is inside brackets(local scope) it not works.

AxAurum · 2016-12-24

Yes, I know that without the brackets everything works fine
but I need to create a function

In any case, your method works really well
I just replaced the "splineOps.delete" in "max delete" and got what I need
Thank you so much you helped me a lot
Happy new year!
cheers!!