Reload component script - anyone have one
-
Thanks Dan,
I hadn't noticed that behaviour before. Initially being only interested in getting a couple of components into the model it wasn't an issue and I would always have the proxies in the model to check that the swap worked ok.
Looking at this again it looks like the components are all loaded into the file in turn. When I repeat ThomThom's text as below only Comp4 gets deleted if not required to replace comp3 (being the last to be loaded). Comp2 get left behind.newDef = model.definitions.load("J:/Comp2.skp")
oldDef = model.definitions['Comp1']
oldDef.instances.each{|old_inst|old_inst.definition=newDef
t = old_inst.transformation
ents = old_inst.parent.entities
ents.add_instance(newDef, t)
old_inst.erase!
}
newDef = model.definitions.load("J:/Comp4.skp")
oldDef = model.definitions['Comp3']
oldDef.instances.each{|old_inst|old_inst.definition=newDef
t = old_inst.transformation
ents = old_inst.parent.entities
ents.add_instance(newDef, t)
old_inst.erase!
}
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better π
Register LoginAdvertisement