Musisback Posted June 27, 2014 Share Posted June 27, 2014 Hello, Is it possible to duplicate a class via Vectorscript? Thanks Quote Link to comment
Hippocode Posted June 29, 2014 Share Posted June 29, 2014 Hello, Is it possible to duplicate a class via Vectorscript? Thanks I don't think there is a function that does that but you can create it yourself. Quote Link to comment
JBenghiat Posted July 8, 2014 Share Posted July 8, 2014 I haven't verified my memory, but I believe CreateDuplicateObject works with classes, using GetObject on the class name. -Josh Quote Link to comment
Musisback Posted July 20, 2015 Author Share Posted July 20, 2015 Well, it works, but it is quite tricky because the duplicate doesn't have a name after duplication... Here's how I do : function duplicateClass(className : string) : string; Const ProvName = '###NewClass###'; VAR newClass, class2duplicate : handle; BEGIN class2duplicate := Getobject(className); newClass := CreateDuplicateObject( class2duplicate,getparent(class2duplicate)); SetName(newclass,ProvName); RenameClass(ProvName ,className); duplicateClass := Getname(newClass); END; Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.