PDA

View Full Version : change class in batch


tom kirkman
07-24-2003, 05:15 AM
Does anyone have a macro they have written to move files from one class to another in batches?

We would like to move all release 2d drawings to a separate class, it would be nice to have a macro that can search for all released drawings and move them.

we would do the same with 3d parts.

Thanks

Tom

fortner
07-29-2003, 07:22 AM
Hello Tom,

Changing elements from class to class could be simple or complex.
The attached file contains a macro that could be a good practical startup macro. It has been designed to change the class for one element at a time. You may use it in a loop browsing a former query for example, as:

QUERY all your release 2D drawings,
and put results, including Db_elid in a logical table
For each table entry
chgclass

But keep in mind that source and destination classes may have different attributes descriptions. For the operation to be successfull they have to be consistent as:
- attributes values defined in the source class but undefined in destination class are definitively lost. Attribute name to name consistency.
- attributes defined in destination class but undefined in the source class could request some mandatory value you should give at change class time.
- common attributes should be equivalent or translatables equivalent type, equivalent data dictionnary constraints, etc.).
Generally at change class time some customization may occur to set up attributes values proper alignment. See source code.
Best regards