PDA

View Full Version : Substitute modifier not working in script?


Billibong
11-20-2005, 03:22 PM
Hi,

I'm writting a script to replace 2d door blocks with a referenced "pivot door". Basically I want all 2d blocks (from AutoCAD) named "Block:XDR-SL-36x8x80" to be replaced by a "pivot door" I create using the same sizes (36"wide, 8"dp, 80" high). The problem is I'm using a substitute modifier and it is writting the correct name of the replacer object in the substitute dialogue box but not actually substituting the object! Am I missing a step here?

DoorRef = $ ---This is my selected pivot door I want to use to use as the replacer object
$.name = "REF-SL-36x8x80" --- I rename the object to this
select DoorJamb --- This is the selected 2d block I want to add the substitute modifer to
modPanel.addModToSelection (Substitute ()) ui:on
$.modifiers[#Substitute].objectName = DoorRef.name
$.modifiers[#Substitute].SubstituteType = "Type: Instance"


Thanks,
Billibong

magicm
11-20-2005, 04:05 PM
Billibong,

You forgot to set the actual reference to the object:

$.modifiers[#Substitute].objectreference = DoorRef

Cheers,
Martijn

Billibong
11-20-2005, 10:45 PM
Thanks,

That works, the wierd thing is that line doesn't appear in the Maxscript listener window when I do a substitute manually.

Thanks Again,
billibong

magicm
11-20-2005, 11:28 PM
A very quick way to get help about a certain command in maxscript is to put your text caret somewhere on a word (like substitute) and press F1. it will take you to the right topic very quickly ;)

- Martijn

CGTalk Moderation
11-20-2005, 11:28 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.