|
<< Click to Display Table of Contents >> Navigation: Programming Mechworks PDM > DBWCommandShell > Commands Reference > Revisions > RenameCurrentRevision |
Renames the revision of the currently selected document with the assigned new name; if <unique id> is passed as optional argument, it works on the document with that unique id. If <eco id> is passed as optional argument, after the <unique id>, the ECO_ID field of the REVISIONS table record is filled with the value passed to the function.
call DBWShell("RenameCurrentRevision NewRevName [DocUID[ECOID]]")
NewRevName |
new name for the revision |
|---|---|
DocUID |
Optional. unique id of the document |
ECOID |
Optional. value that will be written in the ECO_ID field of the REVISION table |
The command renames coherently all the revisions of the DrawingPart óLink Mode related documents.
The command can be executed ONLY if the state of the document is CHECKED IN.
This is useful to promote the approval of a revision to a new name.
If you're working with WorkFlow you must have the field eco_id in your revision table
Database state before the command
T |
ID |
CONFIGURATION |
REVISION |
FILENAME |
STATE |
UID |
|---|---|---|---|---|---|---|
P |
P001 |
C1 |
A1 |
P001.SLDPRT |
CHECKED_IN |
100 |
P |
P001 |
C2 |
A1 |
P001.SLDPRT |
CHECKED_IN |
101 |
P |
P001 |
C3 |
A1 |
P001.SLDPRT |
CHECKED_IN |
102 |
D |
P001 |
A1 |
A1 |
P001.SLDDRW |
CHECKED_IN |
103 |
Then execute the following code:
Sub Main()
DBWInit(TRUE)
DBWShell("RenameCurrentRevision B 100")
DBWShell("IncrementRevisionState 100")
End Sub
The database changes as follows:
T |
ID |
CONFIGURATION |
REVISION |
FILENAME |
STATE |
UID |
|---|---|---|---|---|---|---|
P |
P001 |
C1 |
B |
P001.SLDPRT |
RELEASED |
100 |
P |
P001 |
C2 |
B |
P001.SLDPRT |
RELEASED |
101 |
P |
P001 |
C3 |
B |
P001.SLDPRT |
RELEASED |
102 |
D |
P001 |
B |
P001.SLDDRW |
RELEASED |
103 |