Make Object Names Unique

Rank: 1



posts: 2

Registered: 2011-11-22

Message 1 of 1

 Make Object Names Unique
15-06-2009 04:32 . pm | View his/her posts only
Hello everyone

In VX, the Object is King, not the file containing the Object.

It is necessary therefore to ensure that Root Objects (specifically Parts and Assemblies) have unique names. If you have one or more VX files that contain Objects of identical names, the wrong version of the Object could find it's way into an assembly.

For example, Let's say you have an Assembly File, Assy.VX. In that file is an Assembly that instances a sphere-shaped component "Part001" from a separate file, FileA.VX. If another file exists, FileB.VX, and it too has a Root Object named "Part001", then that Object (which could be a cube!) may get instanced into the Assembly instead of the intended Object.

You can meet-up with this predicament very quickly - Use "Save As" to save PerfectDesign.VX as PerfectDesignMk2.VX and voila, you have two VX files whose Object Names are identical.

So, we understand that to avoid this issue, we must ensure that our Root Object names are unique. The snag is, if you are in the business of defining similar assemblies such as moulds, there are a lot of Parts that essentially have the same name - after all, a plate is a plate is a plate, right?

The solution is simple - the name can be made unique by post-fixing a time-stamp. Simple, but time consuming (no pun intended) if you have hundreds of Objects in one file.

The VxDAL "UniqueName" will time-stamp all Root Object names in the file with just one click. The stamp is guaranteed to be unique because VX "counts" the number of seconds elapsed since 00:00:00 UTC, Jan 1, 1970. Much easier than trying to count those yourself.......

In order to accommodate the time-stamp, the Object name needs to be short, as the total number of characters in all is limited to 31. However, VX v14 avoids this issue by displaying the Object's Description alongside the Name in the Root List. This means that you can have a short Part Object Name, yet if needs be, a longer more descriptive name in the Description (was 85 characters, now 128 characters in v14+).

Did you know that you can drag-out the width of the Root Objects List so that you don't need horizontal scroll?

"UniqueName" can help with the Description too, by optionally copying a currently "long" Name to the Description. It also has a quick edit-name pop up, you can edit the current Object name and/or the proposed new name.

See also