08/25/2012

Cloning a style within the same drawing

The earlier post shows how to import/export styles from/to another drawing, using Cloning Helper utility class in ACA .NET API. Can we use the same function to copy styles within the same drawing? Could you also show me how to use the merge options = 3 when there is possible overlaps?

Solution

You can use the Cloning helper utility class to clone a style within the same drawing, too. The following code demonstrates an usage. Notice that it simply sets the destination and source database as the same database. The code also shows a merge option = 3; i.e., if a style overlaps, it is added as anonymous style name, which starts with "*".

Comments

The earlier post shows how to import/export styles from/to another drawing, using Cloning Helper utility class in ACA .NET API. Can we use the same function to copy styles within the same drawing? Could you also show me how to use the merge options = 3 when there is possible overlaps?

Solution

You can use the Cloning helper utility class to clone a style within the same drawing, too. The following code demonstrates an usage. Notice that it simply sets the destination and source database as the same database. The code also shows a merge option = 3; i.e., if a style overlaps, it is added as anonymous style name, which starts with "*".