Jump to content
Developer Wiki and Function Reference Links Read more... ×
Sign in to follow this  

Duplicate Class

Recommended Posts


Is it possible to duplicate a class via Vectorscript?


I don't think there is a function that does that but you can create it yourself.

Share this post

Link to post

I haven't verified my memory, but I believe CreateDuplicateObject works with classes, using GetObject on the class name.


Share this post

Link to post

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;
   ProvName = '###NewClass###';
   newClass, class2duplicate :  handle;

   class2duplicate := Getobject(className);
   newClass := CreateDuplicateObject( class2duplicate,getparent(class2duplicate));
   RenameClass(ProvName ,className);
   duplicateClass := Getname(newClass);  

Share this post

Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  


7150 Riverwood Drive, Columbia, Maryland 21046, USA   |   Contact Us:   410-290-5114


© 2018 Vectorworks, Inc. All Rights Reserved. Vectorworks, Inc. is part of the Nemetschek Group.