open previous revision

Hello,

I have couple of queries
NXOpen.Part workPart = theSession.Parts.Work;

NXOpen.Annotations.TitleBlock[] titleblocks = new NXOpen.Annotations.TitleBlock[1];
NXOpen.Annotations.EditTitleBlockBuilder editTitleBlockBuilder;
NXOpen.Annotations.TitleBlockCellBuilderList titleBlockCellBuilderList;
Tag objectTag = Tag.Null;

int type;
int subType;
int i = 0;
theUFS.View.CycleObjects(Tag.Null, UFView.CycleObjectsEnum.VisibleObjects, ref objectTag);

if (objectTag != Tag.Null)
{
do
{
theUFS.View.CycleObjects(Tag.Null, UFView.CycleObjectsEnum.VisibleObjects, ref objectTag);

if (objectTag != Tag.Null)
{
theUFS.Obj.AskTypeAndSubtype(objectTag, out type, out subType);

if (type == UFConstants.UF_drafting_entity_type && subType == UFConstants.UF_draft_title_block_subtype)
{

NXOpen.Annotations.TitleBlock titleBlock = (NXOpen.Annotations.TitleBlock)(NXObjectManager.Get(objectTag));
titleblocks[0] = titleBlock;
editTitleBlockBuilder = workPart.DraftingManager.TitleBlocks.CreateEditTitleBlockBuilder(titleblocks);
titleBlockCellBuilderList = editTitleBlockBuilder.Cells;
for (i = 0; i < titleBlockCellBuilderList.Length; i++)
{
string test = titleBlockCellBuilderList.FindItem(i).Label.ToString();
if ((test== "CHANGE DESCRIPTION"))
{
checkLog(titleBlockCellBuilderList.FindItem(i).EditableText.ToString());
}
string S = titleBlockCellBuilderList.FindItem(i).EditableText.ToString();

//theUfSession.Ui.WriteListingWindow("Label --> " + titleBlockCellBuilderList.FindItem(i).Label.ToString() + "\t Value : " + titleBlockCellBuilderList.FindItem(i).EditableText.ToString() + " \n");
}

editTitleBlockBuilder.Destroy();
}
}
} while (objectTag != Tag.Null);

}

public static bool checkLog(string dummy)
{
string encodedName;
NXOpen.Part workPart = theSession.Parts.Work;
theUFS.Part.AskPartName(workPart.Tag, out encodedName);

string partNo;
string partRev;
string partType;
string partName;
theUFS.Ugmgr.DecodePartFileName(encodedName, out partNo, out partRev,
out partType, out partName);

if(partRev!="A")
{
char[] chrs = partRev.ToCharArray();
char lastRev = (char)(chrs[0] - 1);
string encoded;
UFPart.LoadStatus lds;Tag previousRev;
theUFS.Ugmgr.EncodePartFilename(partNo, lastRev.ToString(), null, null, out encoded);
theUFS.Part.OpenQuiet(encoded, out previousRev, out lds);
return false;
}

else return true;
}

I am trying to compare title bloack with previous rev of drawing, i have got the previous released rev, now i have to open drawing of previous rev theufs.part.open opens ugmaster

And can we do this quietly so user cant see previous revision being opened ? somehow freeze or something.
Thanks Again for your support