0
Hello All,

I want to get Item Name(File Name) and its parent directory structure of the all Items in Dimensions using Java API. Below are my code snippet, this successfully displays all the Item Spec inside particular Project.

static void getAllItems(final DimensionsConnection connection)
{
Project project = findProject(connection, "QLARIUS", "MAINLINE_VS_PRJ");
Filter filter = new Filter();
List itemList=project.getChildItems(filter);
Collections.reverse(itemList);
System.out.println(itemList.size());
ItemType itype;


for (Object temp : itemList) {

DimensionsRelatedObject relObj = (DimensionsRelatedObject) temp;
ItemRevision it=(ItemRevision) relObj.getObject();
itype=(ItemType) it.getType();
System.out.println(it.getAttribute(SystemAttributes.OBJECT_SPEC).toString());


}

}



Is there any way to get Item Name and Parent directory structure by its item's spec?


Thanks in advance
Eswaran

Location [ View Larger Map ]

Accepted Answer

Monday, July 20 2015, 01:02 AM - #Permalink
0
I have done it by following way,

static void getAllItems(final DimensionsConnection connection)
{
Project project = findProject(connection, "QLARIUS", "MAINLINE_VS_PRJ");
Filter filter = new Filter();
List itemList=project.getChildItems(filter);
Collections.reverse(itemList);

ItemType itype;
int[] attrNums = { SystemAttributes.OBJECT_ID,
SystemAttributes.FULL_PATH_NAME };

for (Object temp : itemList) {

DimensionsRelatedObject relObj = (DimensionsRelatedObject) temp;
ItemRevision it=(ItemRevision) relObj.getObject();
itype=(ItemType) it.getType();

it.queryAttribute(attrNums);
System.out.println(it.getAttribute(SystemAttributes.FULL_PATH_NAME));


}

}



Thanks
Eswaran
The reply is currently minimized Show
Responses (0)
  • There are no replies here yet.
Your Reply

Recent Tweets