Notifications
Clear all

[Closed] System exception when attaching two objects

Hi. I’m a newbie at maxscript and I’ve got a newbie question. I’m trying to attach one object to another like this:

newObj = Selection[1]
oldObj = Selection[2]
Ep = Edit_Poly()
addModifier oldObj Ep 
OldObj.Modifiers[1].attach newObj

And I’m getting system exception, I think it’s because after attaching Selection[2] will not exist. May be someone will kindly suggest a way around this?

2 Replies
1 Reply
(@miauu)
Joined: 11 months ago

Posts: 0

Since, you want to work with Edit Poly modifeir:


(
	newObj = Selection[1]
	oldObj = Selection[2]
	Ep = Edit_Poly()
	addModifier oldObj Ep 
	--
	select oldObj
	max modify mode
	--
	OldObj.Modifiers[1].attach newObj	
	-- or use this
-- 	oldObj.modifiers[#Edit_Poly].SetOperation #Attach
-- 	oldObj.modifiers[#Edit_Poly].Attach newObj editPolyNode:oldObj
)

It works! Thank a lot!